Index: trunk/core/kernel/application.php =================================================================== diff -u -r2556 -r2566 --- trunk/core/kernel/application.php (.../application.php) (revision 2556) +++ trunk/core/kernel/application.php (.../application.php) (revision 2566) @@ -116,12 +116,18 @@ { if($this->InitDone) return false; - if (defined('DEBUG_MODE') && DEBUG_MODE && dbg_ConstOn('DBG_PROFILE_MEMORY') ) { - global $debugger; - $debugger->appendMemoryUsage('Application before Init:'); + if( $this->isDebugMode() && dbg_ConstOn('DBG_PROFILE_MEMORY') ) + { + $GLOBALS['debugger']->appendMemoryUsage('Application before Init:'); } - if( !$this->isDebugMode() ) set_error_handler( Array(&$this,'handleError') ); + if( !$this->isDebugMode() ) + { + error_reporting(0); + ini_set('display_errors', 0); + + set_error_handler( Array(&$this,'handleError') ); + } $this->DB = new kDBConnection(SQL_TYPE, Array(&$this,'handleSQLError') ); $this->DB->Connect(SQL_SERVER, SQL_USER, SQL_PASS, SQL_DB); @@ -164,11 +170,11 @@ if( $this->isDebugMode() ) { - global $debugger; - $debugger->profileFinish('kernel4_startup'); + $GLOBALS['debugger']->profileFinish('kernel4_startup'); } - if(defined('CMS') && CMS==1 && !$this->GetVar('admin') && !$this->IsAdmin() ){ + if( defined('CMS') && CMS == 1 && !$this->GetVar('admin') && !$this->IsAdmin() ) + { define('MOD_REWRITE', 1); } @@ -269,7 +275,7 @@ $this->registerClass('kCurrencyRates',MODULES_PATH.'/in-commerce/units/currencies/currency_rates.php'); } - $this->registerClass('FCKeditor', DOC_ROOT.BASE_PATH.'/'.ADMIN_DIR.'/editor/cmseditor/fckeditor.php'); + $this->registerClass('FCKeditor', DOC_ROOT.BASE_PATH.'/admin/editor/cmseditor/fckeditor.php'); // need this? /*$this->RegisterClass('LoginController', KERNEL_PATH.'/users/login_controller.php');*/ } @@ -333,9 +339,9 @@ */ function Run() { - if (defined('DEBUG_MODE') && DEBUG_MODE && dbg_ConstOn('DBG_PROFILE_MEMORY') ) { - global $debugger; - $debugger->appendMemoryUsage('Application before Run:'); + if( $this->isDebugMode() && dbg_ConstOn('DBG_PROFILE_MEMORY') ) + { + $GLOBALS['debugger']->appendMemoryUsage('Application before Run:'); } if (!$this->RequestProcessed) $this->ProcessRequest(); @@ -357,16 +363,16 @@ } } - if (defined('DEBUG_MODE') && DEBUG_MODE && dbg_ConstOn('DBG_PROFILE_MEMORY') ) { - global $debugger; - $debugger->appendMemoryUsage('Application before Parsing:'); + if( $this->isDebugMode() && dbg_ConstOn('DBG_PROFILE_MEMORY') ) + { + $GLOBALS['debugger']->appendMemoryUsage('Application before Parsing:'); } $this->HTML = $this->Parser->Parse( $template_cache->GetTemplateBody($t), $t ); - if (defined('DEBUG_MODE') && DEBUG_MODE && dbg_ConstOn('DBG_PROFILE_MEMORY') ) { - global $debugger; - $debugger->appendMemoryUsage('Application after Parsing:'); + if( $this->isDebugMode() && dbg_ConstOn('DBG_PROFILE_MEMORY') ) + { + $GLOBALS['debugger']->appendMemoryUsage('Application after Parsing:'); } } @@ -384,12 +390,13 @@ */ function Done() { - if (defined('DEBUG_MODE') && DEBUG_MODE && dbg_ConstOn('DBG_PROFILE_MEMORY') ) { - global $debugger; - $debugger->appendMemoryUsage('Application before Done:'); + if( $this->isDebugMode() && dbg_ConstOn('DBG_PROFILE_MEMORY') ) + { + $GLOBALS['debugger']->appendMemoryUsage('Application before Done:'); } - if ($this->GetVar('admin')) { + if( $this->GetVar('admin') ) + { $reg = '/('.preg_quote(BASE_PATH, '/').'.*\.html)(#.*){0,1}(")/sU'; $this->HTML = preg_replace($reg, "$1?admin=1$2$3", $this->HTML); } @@ -1139,7 +1146,8 @@ */ function handleError($errno, $errstr, $errfile = '', $errline = '', $errcontext = '') { - if (defined('SILENT_LOG') && SILENT_LOG) { + if( defined('SILENT_LOG') && SILENT_LOG ) + { $fp = fopen(DOC_ROOT.BASE_PATH.'/silent_log.txt','a'); $time = date('d/m/Y H:i:s'); fwrite($fp, '['.$time.'] #'.$errno.': '.strip_tags($errstr).' in ['.$errfile.'] on line '.$errline."\n");