Browse Source

Coverager: use script if extension is not loaded or coverager is not compiled

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@183 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
1.2
Xuefer 15 years ago
parent
commit
adda1f877d
  1. 18
      coverager/coverager.php

18
coverager/coverager.php

@ -130,7 +130,7 @@ class XcacheCoverageViewer
$action = "no data";
}
$xcache_version = XCACHE_VERSION;
$xcache_version = defined('XCACHE_VERSION') ? XCACHE_VERSION : '';
include("coverager.tpl.php");
}
@ -309,6 +309,22 @@ function sprint_cov($cov, $lines, $encode = true)
}
return implode('', $lines);
}
if (!function_exists('xcache_coverager_decode')) {
function xcache_coverager_decode($bytes)
{
$bytes = unpack('l*', $bytes);
$i = 1;
if ($bytes[$i ++] != 0x564f4350) {
return null;
}
$end = count($bytes);
$cov = array();
for (/* empty*/; $i <= $end; $i += 2) {
$cov[$bytes[$i]] = $bytes[$i + 1];
}
return $cov;
}
}
$app = new XcacheCoverageViewer();
$app->main();

Loading…
Cancel
Save