. * * @link http://www.oxid-esales.com * @package main * @copyright (C) OXID eSales AG 2003-2011 * @version OXID eShop CE * @version SVN: $Id: index.php 26911 2010-03-26 17:29:31Z tomas $ */ // Setting error reporting mode error_reporting( E_ALL ^ E_NOTICE ); //Know exactly where in the code the event occurred. //Zend platform only. if (function_exists('monitor_set_aggregation_hint') && isset($_REQUEST['cl'])) { $sAgregationHint = htmlentities($_REQUEST['cl'], ENT_QUOTES, 'UTF-8') . '/'; if (isset($_REQUEST['fnc'])) $sAgregationHint .= htmlentities($_REQUEST['fnc'], ENT_QUOTES, 'UTF-8'); monitor_set_aggregation_hint($sAgregationHint); } //setting basic configuration parameters ini_set('session.name', 'sid' ); ini_set('session.use_cookies', 0 ); ini_set('session.use_trans_sid', 0); ini_set('url_rewriter.tags', ''); ini_set('magic_quotes_runtime', 0); /** * Returns shop base path. * * @return string */ function getShopBasePath() { return dirname(__FILE__).'/'; } if ( !function_exists( 'isAdmin' )) { /** * Returns false. * * @return bool */ function isAdmin() { return false; } } // custom functions file require getShopBasePath() . 'modules/functions.php'; // Generic utility method file require_once getShopBasePath() . 'core/oxfunctions.php'; // set the exception handler already here to catch everything, also uncaught exceptions from the config or utils // initializes singleton config class $myConfig = oxConfig::getInstance(); // reset it so it is done with oxnew $iDebug = $myConfig->getConfigParam('iDebug'); set_exception_handler(array(oxNew('oxexceptionhandler', $iDebug), 'handleUncaughtException')); // Admin handling if ( isAdmin() ) { $myConfig->setConfigParam( 'blAdmin', true ); $myConfig->setConfigParam( 'blTemplateCaching', false ); if ($sAdminDir) $myConfig->setConfigParam( 'sAdminDir', $sAdminDir ); else $myConfig->setConfigParam( 'sAdminDir', "admin" ); } //Invoked over search engine URLs if (isSearchEngineUrl()) { oxNew('oxSeoDecoder')->processSeoCall(); } //Starting the shop $oShopControl = oxNew('oxShopControl'); startProfile('start'); $oShopControl->start(); stopProfile('start'); //DEBUG INFO if (!isAdmin() && $iDebug) { echo "cl=".oxConfig::getInstance()->getActiveView()->getClassName(); if ($sFnc = oxConfig::getInstance()->getActiveView()->getFncName()) echo " fnc=$sFnc"; echo "
\n"; } if (!isAdmin() && $iDebug && is_array($aProfileTimes)) { echo "----------------------------------------------------------
".PHP_EOL; $iTotalTime = $oShopControl->getTotalTime(); arsort($aProfileTimes); echo ""; foreach ($aProfileTimes as $sKey => $sVal) { echo "" ; if ($iTotalTime) { echo ""; } if ($aExecutionCounts[$sKey]) { echo " " ."" ."" . PHP_EOL; } else { echo " " . PHP_EOL; } } echo "
Profile $sKey: " . round($sVal, 5) ."s".round($sVal*100/$iTotalTime, 2)."%" . $aExecutionCounts[$sKey] . "*" . round($sVal / $aExecutionCounts[$sKey], 5) . "s
not stopped correctly!
"; } if (!isAdmin() && ($iDebug == 7)) { echo "----------------------------------------------------------
".PHP_EOL; echo "-- oxdebugdb --
".PHP_EOL; $oDbgDb = oxNew('oxdebugdb'); $aWarnings = $oDbgDb->getWarnings(); $iNr = 1; foreach ($aWarnings as $w) { echo "{$w['check']}: {$w['time']} - ".htmlentities($w['sql'], ENT_QUOTES, 'UTF-8').""; echo ""; echo "TRACE (show/hide)

"; ++$iNr; } } if (!isAdmin() && ($iDebug == 2 || $iDebug == 3 || $iDebug == 4)) { $oPerfMonitor = @NewPerfMonitor( oxDb::getDb() ); if ( $oPerfMonitor ) $oPerfMonitor->UI( 5 ); }