Code coverage

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@514 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2008-10-02 16:42:55 +00:00
parent c49331e594
commit bb1ae0ba54
6 changed files with 108 additions and 1 deletions

View File

@@ -12,6 +12,19 @@ if (!ini_get("session.auto_start")) {
session_set_cookie_params(ini_get("session.cookie_lifetime"), preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"]));
session_start();
}
if (isset($_SESSION["coverage"])) {
function save_coverage() {
foreach (xdebug_get_code_coverage() as $filename => $lines) {
foreach ($lines as $l => $val) {
if (!$_SESSION["coverage"][$filename][$l] || $val > 0) {
$_SESSION["coverage"][$filename][$l] = $val;
}
}
}
}
xdebug_start_code_coverage(XDEBUG_CC_UNUSED | XDEBUG_CC_DEAD_CODE);
register_shutdown_function('save_coverage');
}
if (get_magic_quotes_gpc()) {
$process = array(&$_GET, &$_POST);
while (list($key, $val) = each($process)) {