From 304c479dba7b3b68d8b69e6fbb27b5239bd7e71b Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 27 Sep 2009 14:04:27 +0100 Subject: [PATCH] make debugging and coverage separate settings --- core/util.inc.php | 4 ++-- index.php | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/util.inc.php b/core/util.inc.php index c74231f5..3788403a 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -808,14 +808,14 @@ function _end_cache() { * Code coverage * \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -function _start_debug() { +function _start_coverage() { if(function_exists("xdebug_start_code_coverage")) { #xdebug_start_code_coverage(XDEBUG_CC_UNUSED|XDEBUG_CC_DEAD_CODE); xdebug_start_code_coverage(XDEBUG_CC_UNUSED); } } -function _end_debug() { +function _end_coverage() { if(function_exists("xdebug_get_code_coverage")) { if(!file_exists("data/coverage")) mkdir("data/coverage"); $n = 0; diff --git a/index.php b/index.php index 325abe87..c13cb243 100644 --- a/index.php +++ b/index.php @@ -52,6 +52,7 @@ // set up and purify the environment define("DEBUG", true); +define("COVERAGE", true); define("CACHE_MEMCACHE", false); define("CACHE_DIR", false); define("SCORE_VERSION", 's2hack'); @@ -64,7 +65,7 @@ if(!file_exists("config.php")) { require_once "config.php"; require_once "core/util.inc.php"; -if(DEBUG) {_start_debug();} +if(COVERAGE) {_start_coverage();} _version_check(); _sanitise_environment(); _start_cache(); @@ -148,5 +149,5 @@ catch(Exception $e) { EOD; } -if(DEBUG) {_end_debug();} +if(COVERAGE) {_end_coverage();} ?>