summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Schneider2009-11-08 03:54:16 +0000
committerChristian Schneider2009-11-08 03:54:16 +0000
commit544a163146c743b0645ce5e90af27a1ed334ef73 (patch)
tree4a0c90c3f758d1fadb90ec284883c050333536fc
parent977b30850c02c90227f48f5bf89c4552adccbe92 (diff)
downloaditools-544a163146c743b0645ce5e90af27a1ed334ef73.tar.gz
itools-544a163146c743b0645ce5e90af27a1ed334ef73.tar.bz2
itools-544a163146c743b0645ce5e90af27a1ed334ef73.zip
Add shutdown handler to make it::timerlog work
-rw-r--r--it_auto_prepend.php8
1 files changed, 8 insertions, 0 deletions
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 <http://www.gnu.org/licenses/>.
*/
+$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));
+}