From 544a163146c743b0645ce5e90af27a1ed334ef73 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Sun, 8 Nov 2009 03:54:16 +0000 Subject: Add shutdown handler to make it::timerlog work --- it_auto_prepend.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'it_auto_prepend.php') diff --git a/it_auto_prepend.php b/it_auto_prepend.php index d683116..d946e78 100644 --- a/it_auto_prepend.php +++ b/it_auto_prepend.php @@ -19,6 +19,7 @@ ** along with this program. If not, see . */ +$GLOBALS['ULTRATIME'] = gettimeofday(); unset($GLOBALS['IT_SYNTAXCONVERTER_DIR']); # Security measure for register_globals on #$debug_itclassloader = true; @@ -35,6 +36,7 @@ function it_initialize() if (!$it_initrecursion++) { + register_shutdown_function('it_shutdown'); $error_reporting = error_reporting(); error_reporting($error_reporting & ~E_NOTICE); # ITools is not (unpatched) E_NOTICE safe $it_path = dirname(__FILE__); @@ -232,3 +234,9 @@ function it_errorhandler($errno, $errstr, $errfile, $errline, $errcontext) return $result; # True means do not execute standard PHP error handler } + +function it_shutdown() +{ + if (isset($GLOBALS['debug_timerlog']) && !empty($GLOBALS['ULTRATIMERLOG'])) + it::log('timerlog', $_SERVER['REQUEST_URI'] . "\t" . substr($GLOBALS['ULTRATIMERLOG'], 1)); +} -- cgit v1.2.3