File: D:/HostingSpaces/PvdBoogaard/indoorski.nl/backup/oude-site/cms/lib/debug.php
<?php
/**
* This file has the callback function for the output buffering when debug mode is turned on.
*
* @package IWP
*/
/**
* This is the function that is used for the output buffering callback. If debug mode is on it will output the time taken to load a page.
* This will also call the ob_gzhandler to output the final data.
* This function should never be called directly.
*
* @param string $data
* @param unknown_type $mode
* @return string
*/
function ob_callback_debug($data, $mode)
{
if(strpos($_SERVER['PHP_SELF'], 'js.php') === false){
$GLOBALS['end_time'] = microtime_float();
$str = '';
if (!eregi("remote\.php",$_SERVER['PHP_SELF'])) {
if (function_exists('memory_get_usage')) {
$mem_used = memory_get_usage()/1024/1024;
} else {
$mem_used = 0;
}
$str = sprintf("\n\n\n".'<br /><div id="debug" style="color: #808080; background-color: #ECECEC;clear:both;padding-top: 2px;"><center>Time taken to generate the page %.4f seconds and performed %d sql queries and used %.4f MB of memory</center></div>'."\n\n\n", ($GLOBALS['end_time'] - $GLOBALS['start_time']), $GLOBALS['DBNumQueries'], $mem_used);
}
}
if (function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) {
return ob_gzhandler($data . $str, $mode);
} else {
return $data;
}
} // end function ob_callback_debug()