Index: trunk/core/kernel/utility/debugger.php
===================================================================
diff -u -r4467 -r4569
--- trunk/core/kernel/utility/debugger.php (.../debugger.php) (revision 4467)
+++ trunk/core/kernel/utility/debugger.php (.../debugger.php) (revision 4569)
@@ -71,7 +71,7 @@
'output_buffer' => 4, 'highlight_output' => 8);
var $scrollbarWidth = 0;
-
+
var $longErrors = Array();
/**
@@ -87,15 +87,16 @@
var $reportDone = false;
- var $dummyImage = 'http://www.adamauto.lv/chevrolet/images/spacer.gif';
-
+ var $dummyImage = '';
+
function Debugger()
{
+ $this->dummyImage = PROTOCOL.SERVER_NAME.(defined('PORT')?':'.PORT : '').rtrim(BASE_PATH, '/').'/'.'kernel/admin_templates/img/spacer.gif';
$this->profileStart('kernel4_startup', 'Startup and Initialization of kernel4');
$this->profileStart('script_runtime', 'Script runtime');
ini_set('display_errors', dbg_ConstOn('DBG_ZEND_PRESENT') ? 0 : 1);
$this->memoryUsage['error_handling'] = 0; // memory amount used by error handler
-
+
$this->scrollbarWidth = $this->isGecko() ? 22 : 25;
dbg_safeDefine('DBG_WINDOW_WIDTH', 700);
$this->appendRequest();
@@ -215,24 +216,24 @@
$profileKey = $Data['profile_key'];
$Data =& $this->ProfilerData[$profileKey];
$runtime = ($Data['ends'] - $Data['begins']); // in seconds
-
-
+
+
$totals_key = getArrayValue($Data, 'totalsKey');
if ($totals_key) {
$total_before = $Data['totalsBefore'];
$total = $this->ProfilerTotals[$totals_key];
-
+
$div_width = Array();
$div_width['before'] = ($total_before / $total) * $this->getWindowWidth();
$div_width['current'] = ($runtime / $total) * $this->getWindowWidth();
$div_width['left'] = (($total - $total_before - $runtime) / $total) * $this->getWindowWidth();
-
+
$ret = 'Name: '.$Data['description'].'
';
$ret .= 'Runtime: '.$runtime.'s';
$ret .= '

';
$ret .= '
';
$ret .= '
';
-
+
return $ret;
}
else {
@@ -250,11 +251,11 @@
{
return DBG_WINDOW_WIDTH - $this->scrollbarWidth;
}
-
+
function isApplication(&$object)
{
$app_class = defined('APPLICATION_CLASS') ? strtolower(APPLICATION_CLASS) : 'kApplication';
- return get_class($object) == $app_class;
+ return strtolower(get_class($object)) == $app_class;
}
function processTraceArguments(&$traceArgs)
@@ -272,7 +273,7 @@
{
array_push($this->RecursionStack, get_class($argValue));
- if( get_class($argValue) == 'kfactory' || $this->isApplication($argValue) || get_class($argValue) == 'templateparser' )
+ if( strtolower(get_class($argValue)) == 'kfactory' || $this->isApplication($argValue) || strtolower(get_class($argValue)) == 'templateparser' )
{
$argValue = null;
continue;
@@ -335,16 +336,16 @@
return $string;
}
}
-
+
function isGecko()
{
return strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'firefox') !== false;
}
-
+
function getFileLink($file, $lineno = 1, $title = '')
{
if (!$title) $title = $file;
-
+
if ($this->isGecko()) {
return ''.$title.'';
}
@@ -435,7 +436,7 @@
else {
$script = $_SERVER['DOCUMENT_ROOT'].$_SERVER['PHP_SELF'];
}
-
+
$this->appendHTML('ScriptName: '.$this->getFileLink($script,1,basename($script)).' ('.dirname($script).')');
$this->appendHTML('DomViewer: ');
@@ -486,14 +487,14 @@
if (isset($description)) {
$this->ProfilerData[$key]['description'] = $description;
}
-
+
$this->Data[] = array('profile_key' => $key, 'debug_type' => 'profiler');
}
function profileFinish($key, $description = null)
{
$this->ProfilerData[$key]['ends'] = $this->getMoment();
-
+
if (isset($description)) {
$this->ProfilerData[$key]['description'] = $description;
}
@@ -508,12 +509,12 @@
if (!isset($value)) {
$value = $this->ProfilerData[$key]['ends'] - $this->ProfilerData[$key]['begins'];
}
-
+
if (isset($key)) {
$this->ProfilerData[$key]['totalsKey'] = $total_key;
$this->ProfilerData[$key]['totalsBefore'] = $this->ProfilerTotals[$total_key];
}
-
+
$this->ProfilerTotals[$total_key] += $value;
$this->ProfilerTotalCount[$total_key]++;
}
@@ -575,6 +576,7 @@
*/
function printReport($returnResult = false, $clean_output_buffer = true)
{
+ $this->breakOutofBuffering();
if($this->reportDone) return '';
if( dbg_ConstOn('DBG_SKIP_REPORTING') ) return;
@@ -642,7 +644,7 @@
$i = 0; $lineCount = count($this->Data);
- if( !ob_get_length() ) ob_start();
+ ob_start();
?>