changed the windows coverage fix from closure to parameter passing, since older phps can't do that
This commit is contained in:
parent
e5b3afb31c
commit
52f5a265fa
@ -989,17 +989,13 @@ function _start_coverage() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function _end_coverage() {
|
function _end_coverage( $dir ) {
|
||||||
if(function_exists("xdebug_get_code_coverage")) {
|
if(function_exists("xdebug_get_code_coverage")) {
|
||||||
$dir = getcwd();
|
if(!file_exists("$dir/data/coverage")) mkdir("$dir/data/coverage");
|
||||||
$end_cov = function() use ( $dir ) {
|
$n = 0;
|
||||||
if(!file_exists("$dir/data/coverage")) mkdir("$dir/data/coverage");
|
$t = time();
|
||||||
$n = 0;
|
while(file_exists("$dir/data/coverage/$t.$n.log")) $n++;
|
||||||
$t = time();
|
file_put_contents("$dir/data/coverage/$t.$n.log", serialize(xdebug_get_code_coverage()));
|
||||||
while(file_exists("$dir/data/coverage/$t.$n.log")) $n++;
|
|
||||||
file_put_contents("$dir/data/coverage/$t.$n.log", serialize(xdebug_get_code_coverage()));
|
|
||||||
};
|
|
||||||
return $end_cov;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -68,7 +68,8 @@ require_once "config.php";
|
|||||||
require_once "core/util.inc.php";
|
require_once "core/util.inc.php";
|
||||||
if(COVERAGE) {
|
if(COVERAGE) {
|
||||||
_start_coverage();
|
_start_coverage();
|
||||||
register_shutdown_function(_end_coverage());
|
$dir = getcwd();
|
||||||
|
register_shutdown_function( "_end_coverage", $dir );
|
||||||
}
|
}
|
||||||
_version_check();
|
_version_check();
|
||||||
_sanitise_environment();
|
_sanitise_environment();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user