00001 <?php
00002
00003
00004 error_reporting( E_ALL ^ E_NOTICE );
00005
00006
00007
00008 if (function_exists('monitor_set_aggregation_hint') && isset($_REQUEST['cl'])) {
00009 $sAgregationHint = htmlentities($_REQUEST['cl'], ENT_QUOTES, 'UTF-8') . '/';
00010 if (isset($_REQUEST['fnc']))
00011 $sAgregationHint .= htmlentities($_REQUEST['fnc'], ENT_QUOTES, 'UTF-8');
00012 monitor_set_aggregation_hint($sAgregationHint);
00013 }
00014
00015
00016
00017 ini_set('session.name', 'sid' );
00018 ini_set('session.use_cookies', 0 );
00019 ini_set('session.use_trans_sid', 0);
00020 ini_set('url_rewriter.tags', '');
00021 ini_set('magic_quotes_runtime', 0);
00022
00028 function getShopBasePath()
00029 {
00030 return dirname(__FILE__).'/';
00031 }
00032
00038 if ( !function_exists( 'isAdmin' )) {
00039 function isAdmin()
00040 {
00041 return false;
00042 }
00043 }
00044
00045
00046 include getShopBasePath() . 'modules/functions.php';
00047
00048
00049 require_once getShopBasePath() . 'core/oxfunctions.php';
00050
00051
00052
00053
00054
00055 $myConfig = oxConfig::getInstance();
00056
00057
00058 $iDebug = $myConfig->getConfigParam('iDebug');
00059 set_exception_handler(array(oxNew('oxexceptionhandler', $iDebug), 'handleUncaughtException'));
00060
00061 if ( isAdmin() ) {
00062 $myConfig->setConfigParam( 'blAdmin', true );
00063 $myConfig->setConfigParam( 'blTemplateCaching', false );
00064 if ($sAdminDir)
00065 $myConfig->setConfigParam( 'sAdminDir', $sAdminDir );
00066 else
00067 $myConfig->setConfigParam( 'sAdminDir', "admin" );
00068 }
00069
00070
00071 if (isSearchEngineUrl()) {
00072 oxNew('oxSeoDecoder')->processSeoCall();
00073 }
00074
00075
00076 $oShopControl = oxNew('oxShopControl');
00077
00078 startProfile('start');
00079 $oShopControl->start();
00080 stopProfile('start');
00081
00082
00083
00084 if (!isAdmin() && $iDebug) {
00085 echo "cl=".oxConfig::getInstance()->getActiveView()->getClassName();
00086 if ($sFnc = oxConfig::getInstance()->getActiveView()->getFncName())
00087 echo " fnc=$sFnc";
00088
00089 echo "<br>\n";
00090 }
00091
00092
00093 if (!isAdmin() && $iDebug && is_array($aProfileTimes)) {
00094 echo "----------------------------------------------------------<br>".PHP_EOL;
00095 $iTotalTime = $oShopControl->dTimeEnd - $oShopControl->dTimeStart;
00096 arsort($aProfileTimes);
00097 echo "<table cellspacing='10px' style='border: 1px solid #000'>";
00098 foreach ($aProfileTimes as $sKey => $sVal)
00099 {
00100 echo "<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>" ;
00101 if ($iTotalTime) {
00102 echo "<td style='border-bottom: 1px dotted #000;min-width:100px;'>".round($sVal*100/$iTotalTime, 2)."%</td>";
00103 }
00104 if ($aExecutionCounts[$sKey]) {
00105 echo " <td style='border-bottom: 1px dotted #000;min-width:50px;padding-right:30px;' align='right'>" . $aExecutionCounts[$sKey] . "</td>"
00106 ."<td style='border-bottom: 1px dotted #000;min-width:15px; '>*</td>"
00107 ."<td style='border-bottom: 1px dotted #000;min-width:100px;'>" . round($sVal / $aExecutionCounts[$sKey], 5) . "s</td></tr>" . PHP_EOL;
00108 } else {
00109 echo " <td colspan=3 style='border-bottom: 1px dotted #000;min-width:100px;'> not stopped correctly! </td></tr>" . PHP_EOL;
00110 }
00111 }
00112 echo "</table>";
00113 }
00114
00115 if (!isAdmin() && ($iDebug == 7))
00116 {
00117 echo "----------------------------------------------------------<br>".PHP_EOL;
00118 echo "-- oxdebugdb --<br>".PHP_EOL;
00119 $oDbgDb = oxNew('oxdebugdb');
00120 $aWarnings = $oDbgDb->getWarnings();
00121 $_iNr = 1;
00122 foreach ($aWarnings as $w)
00123 {
00124 echo "{$w['check']}: {$w['time']} - <span style='color:#900000;margin:5px'>".htmlentities($w['sql'], ENT_QUOTES, 'UTF-8')."</span>";
00125 echo "<div id='dbgdb_trace_$_iNr' style='display:none'>".nl2br($w['trace'])."</div>";
00126 echo "<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>";
00127 ++$_iNr;
00128 }
00129 }
00130
00131 if (!isAdmin() && ($iDebug == 2 || $iDebug == 3 || $iDebug == 4)) {
00132 $oPerfMonitor = @NewPerfMonitor( oxDb::getDb() );
00133 if ( $oPerfMonitor )
00134 $oPerfMonitor->UI( 5 );
00135 }