Index: branches/5.2.x/core/kernel/utility/debugger.php =================================================================== diff -u -N -r15115 -r15130 --- branches/5.2.x/core/kernel/utility/debugger.php (.../debugger.php) (revision 15115) +++ branches/5.2.x/core/kernel/utility/debugger.php (.../debugger.php) (revision 15130) @@ -1,6 +1,6 @@ tempFolder); + $debugger_params = Array ( + 'RowSeparator' => $this->rowSeparator, + 'ErrorsCount' => (int)$this->getProfilerTotal('error_handling'), + 'IsFatalError' => $this->IsFatalError ? 'true' : 'false', + 'SQLCount' => (int)$this->getProfilerTotal('sql'), + 'SQLTime' => isset($this->ProfilerTotals['sql']) ? sprintf('%.5f', $this->ProfilerTotals['sql']) : 0, + 'ScriptTime' => sprintf('%.5f', $this->ProfilerData['script_runtime']['ends'] - $this->ProfilerData['script_runtime']['begins']), + 'ScriptMemory' => DebuggerUtil::formatSize($this->getMemoryUsed($debugger_start)), + ); + ob_start(); // the - + ProfilerTotals['error_handling']) ) { - $memory_used = $debugger_start; - $this->ProfilerTotalCount['error_handling'] = 0; - } - else { - $memory_used = $debugger_start - $this->ProfilerTotals['error_handling']; - } - if ( $returnResult ) { $ret = ob_get_contents(); if ( $clean_output_buffer ) { ob_end_clean(); } - $ret .= $this->getShortReport($memory_used); + $ret .= $this->getShortReport($this->getMemoryUsed($debugger_start)); $this->reportDone = true; return $ret; @@ -1589,14 +1591,27 @@ elseif ( $clean_output_buffer ) { ob_clean(); } - echo $this->getShortReport($memory_used); + echo $this->getShortReport($this->getMemoryUsed($debugger_start)); $this->reportDone = true; } return ''; } + function getMemoryUsed($debugger_start) + { + if ( !isset($this->ProfilerTotals['error_handling']) ) { + $memory_used = $debugger_start; + $this->ProfilerTotalCount['error_handling'] = 0; + } + else { + $memory_used = $debugger_start - $this->ProfilerTotals['error_handling']; + } + + return $memory_used; + } + /** * Format's memory usage report by debugger * @@ -1607,11 +1622,8 @@ private function getShortReport($memory_used) { if ( DebuggerUtil::constOn('DBG_TOOLBAR_BUTTONS') ) { - // we have sql & error count in toolbar, don't duplicate here - $info = Array ( - 'Script Runtime' => 'PROFILE:script_runtime', - 'SQL\'s Runtime' => 'PROFILE_T:sql', - ); + // evenrything is in toolbar - don't duplicate + return ''; } else { // toolbar not visible, then show sql & error count too @@ -1624,7 +1636,7 @@ ); } - $ret = 'Application:' . DebuggerUtil::formatSize($memory_used) . ' (' . $memory_used . ')'; + $ret = ''; // 'Application:' . DebuggerUtil::formatSize($memory_used) . ' (' . $memory_used . ')'; foreach ($info as $title => $value_key) { list ($record_type, $record_data) = explode(':', $value_key, 2);