20 while ( list( $sViewName, $oViewData ) = each( $aViewData ) ) {
22 $sLog .=
"TemplateData[$sViewName] : <br />\n";
23 $sLog .= print_r( $oViewData, 1);
36 if ( function_exists(
'memory_get_usage' ) ) {
37 $iKb = ( int ) ( memory_get_usage() / 1024 );
38 $iMb = round($iKb / 1024, 3);
39 $sLog .=
'Memory usage: '.$iMb.
' MB';
41 if ( function_exists(
'memory_get_peak_usage' ) ) {
42 $iPeakKb = ( int ) ( memory_get_peak_usage() / 1024 );
43 $iPeakMb = round($iPeakKb / 1024, 3);
44 $sLog .=
' (peak: '.$iPeakMb.
' MB)';
48 if ( version_compare( PHP_VERSION,
'5.2.0',
'>=' ) ) {
49 $iKb = ( int ) ( memory_get_usage(
true ) / 1024 );
50 $iMb = round($iKb / 1024, 3);
51 $sLog .=
'System memory usage: '.$iMb.
' MB';
53 if ( function_exists(
'memory_get_peak_usage' ) ) {
54 $iPeakKb = ( int ) ( memory_get_peak_usage(
true ) / 1024 );
55 $iPeakMb = round($iPeakKb / 1024, 3);
56 $sLog .=
' (peak: '.$iPeakMb.
' MB)';
73 $sLog =
'Execution time:'.round($dTotalTime, 4).
'<br />';
74 global $aProfileTimes;
75 global $aExecutionCounts;
76 global $aProfileBacktraces;
77 if (is_array($aProfileTimes)) {
78 $sLog .=
"----------------------------------------------------------<br>".PHP_EOL;
79 arsort($aProfileTimes);
80 $sLog .=
"<table cellspacing='10px' style='border: 1px solid #000'>";
82 foreach ($aProfileTimes as $sKey => $sVal) {
83 $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>" ;
85 $sLog .=
"<td style='border-bottom: 1px dotted #000;min-width:100px;'>".round($sVal*100/$dTotalTime, 2).
"%</td>";
87 if ($aExecutionCounts[$sKey]) {
88 $sLog .=
" <td style='border-bottom: 1px dotted #000;min-width:50px;padding-right:30px;' align='right'>" . $aExecutionCounts[$sKey] .
"</td>"
89 .
"<td style='border-bottom: 1px dotted #000;min-width:15px; '>*</td>"
90 .
"<td style='border-bottom: 1px dotted #000;min-width:100px;'>" . round($sVal / $aExecutionCounts[$sKey], 5) .
"s</td>" . PHP_EOL;
92 $sLog .=
" <td colspan=3 style='border-bottom: 1px dotted #000;min-width:100px;'> not stopped correctly! </td>" . PHP_EOL;
95 if (isset($aProfileBacktraces[$sKey])) {
96 $sLog .=
"<td style='border-bottom: 1px dotted #000;min-width:15px; '>";
97 foreach ($aProfileBacktraces[$sKey] as $sBtId => $aBt) {
98 $iCnt = (int)$aProfileBacktraceCounts[$sBtId];
99 $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>";
100 $sLog .=
"<div id='profdbg_trace_$iNr' style='display:none'>";
101 foreach ($aBt as $iLevel => $aInfo) {
102 $sLog .=
"<i><strong>$iLevel: {$aInfo['function']}</strong></i> at {$aInfo['file']}:{$aInfo['line']}<br>";
124 $sLog =
"cl=".oxRegistry::getConfig()->getActiveView()->getClassName();
126 $sLog .=
" fnc=$sFnc";
138 $sLog =
"----------------------------------------------------------<br>".PHP_EOL;
139 $sLog .=
"-- oxdebugdb --<br>".PHP_EOL;
140 $oDbgDb =
oxNew(
'oxdebugdb');
141 $aWarnings = $oDbgDb->getWarnings();
143 foreach ($aWarnings as $w) {
144 $sLog .=
"{$w['check']}: {$w['time']} - <span style='color:#900000;margin:5px'>".htmlentities($w[
'sql'], ENT_QUOTES,
'UTF-8').
"</span>";
145 $sLog .=
"<div id='dbgdb_trace_$iNr' style='display:none'>".nl2br($w[
'trace']).
"</div>";
146 $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>";
160 if ( $oPerfMonitor ) {
162 $oPerfMonitor->UI( 5 );
163 return ob_get_clean();
177 $sLog .=
"<div id='". $sClassName .
"_executed'>Executed: ". date(
'Y-m-d H:i:s' ) .
"</div>";
178 $sLog .=
"<div id='". $sClassName .
"_timestamp'>Timestamp: ". microtime(
true) .
"</div>";