21 while (list($sViewName, $oViewData) = each($aViewData)) {
23 $sLog .=
"TemplateData[$sViewName] : <br />\n";
24 $sLog .= print_r($oViewData, 1);
38 if (function_exists(
'memory_get_usage')) {
39 $iKb = ( int ) (memory_get_usage() / 1024);
40 $iMb = round($iKb / 1024, 3);
41 $sLog .=
'Memory usage: ' . $iMb .
' MB';
43 if (function_exists(
'memory_get_peak_usage')) {
44 $iPeakKb = ( int ) (memory_get_peak_usage() / 1024);
45 $iPeakMb = round($iPeakKb / 1024, 3);
46 $sLog .=
' (peak: ' . $iPeakMb .
' MB)';
50 if (version_compare(PHP_VERSION,
'5.2.0',
'>=')) {
51 $iKb = ( int ) (memory_get_usage(
true) / 1024);
52 $iMb = round($iKb / 1024, 3);
53 $sLog .=
'System memory usage: ' . $iMb .
' MB';
55 if (function_exists(
'memory_get_peak_usage')) {
56 $iPeakKb = ( int ) (memory_get_peak_usage(
true) / 1024);
57 $iPeakMb = round($iPeakKb / 1024, 3);
58 $sLog .=
' (peak: ' . $iPeakMb .
' MB)';
76 $sLog =
'Execution time:' . round($dTotalTime, 4) .
'<br />';
77 global $aProfileTimes;
78 global $aExecutionCounts;
79 global $aProfileBacktraces;
80 if (is_array($aProfileTimes)) {
81 $sLog .=
"----------------------------------------------------------<br>" . PHP_EOL;
82 arsort($aProfileTimes);
83 $sLog .=
"<table cellspacing='10px' style='border: 1px solid #000'>";
85 foreach ($aProfileTimes as $sKey => $sVal) {
86 $sLog .=
"<tr><td style='border-bottom: 1px dotted #000;min-width:300px;'>Profile $sKey: </td><td style='border-bottom: 1px dotted #000;min-width:100px;'>" . round($sVal, 5) .
"s</td>";
88 $sLog .=
"<td style='border-bottom: 1px dotted #000;min-width:100px;'>" . round($sVal * 100 / $dTotalTime, 2) .
"%</td>";
90 if ($aExecutionCounts[$sKey]) {
91 $sLog .=
" <td style='border-bottom: 1px dotted #000;min-width:50px;padding-right:30px;' align='right'>" . $aExecutionCounts[$sKey] .
"</td>"
92 .
"<td style='border-bottom: 1px dotted #000;min-width:15px; '>*</td>"
93 .
"<td style='border-bottom: 1px dotted #000;min-width:100px;'>" . round($sVal / $aExecutionCounts[$sKey], 5) .
"s</td>" . PHP_EOL;
95 $sLog .=
" <td colspan=3 style='border-bottom: 1px dotted #000;min-width:100px;'> not stopped correctly! </td>" . PHP_EOL;
98 if (isset($aProfileBacktraces[$sKey])) {
99 $sLog .=
"<td style='border-bottom: 1px dotted #000;min-width:15px; '>";
100 foreach ($aProfileBacktraces[$sKey] as $sBtId => $aBt) {
101 $iCnt = (int) $aProfileBacktraceCounts[$sBtId];
102 $sLog .=
"<a style='color:#00AA00;margin:5px;cursor:pointer' onclick='var el=document.getElementById(\"profdbg_trace_$iNr\"); if (el.style.display==\"block\")el.style.display=\"none\"; else el.style.display = \"block\";'>Count($iCnt) - TRACE (show/hide)</a><br><br>";
103 $sLog .=
"<div id='profdbg_trace_$iNr' style='display:none'>";
104 foreach ($aBt as $iLevel => $aInfo) {
105 $sLog .=
"<i><strong>$iLevel: {$aInfo['function']}</strong></i> at {$aInfo['file']}:{$aInfo['line']}<br>";
130 $sLog .=
" fnc=$sFnc";
145 $sLog =
"----------------------------------------------------------<br>" . PHP_EOL;
146 $sLog .=
"-- oxdebugdb --<br>" . PHP_EOL;
147 $oDbgDb =
oxNew(
'oxdebugdb');
148 $aWarnings = $oDbgDb->getWarnings();
150 foreach ($aWarnings as $w) {
151 $sLog .=
"{$w['check']}: {$w['time']} - <span style='color:#900000;margin:5px'>" . htmlentities($w[
'sql'], ENT_QUOTES,
'UTF-8') .
"</span>";
152 $sLog .=
"<div id='dbgdb_trace_$iNr' style='display:none'>" . nl2br($w[
'trace']) .
"</div>";
153 $sLog .=
"<a style='color:#00AA00;margin:5px;cursor:pointer' onclick='var el=document.getElementById(\"dbgdb_trace_$iNr\"); if (el.style.display==\"block\")el.style.display=\"none\"; else el.style.display = \"block\";'>TRACE (show/hide)</a><br><br>";
172 $oPerfMonitor->UI(5);
174 return ob_get_clean();
189 $sLog .=
"<div id='" . $sClassName .
"_executed'>Executed: " . date(
'Y-m-d H:i:s') .
"</div>";
190 $sLog .=
"<div id='" . $sClassName .
"_timestamp'>Timestamp: " . microtime(
true) .
"</div>";