From d8d14cd6b09a158c5010356bf14aee76f60a900b Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 11 Dec 2005 01:08:27 +0000 Subject: Fixed a syntax error in PradoBase class, which would cause a recursive raising of exceptions. --- framework/TApplication.php | 11 +---------- framework/core.php | 2 +- framework/prado.php | 10 ++++++---- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/framework/TApplication.php b/framework/TApplication.php index 7556d94c..6e43fbf1 100644 --- a/framework/TApplication.php +++ b/framework/TApplication.php @@ -214,12 +214,12 @@ class TApplication extends TComponent public function __construct($configFile,$cacheFile=null) { parent::__construct(); + Prado::setApplication($this); if(($this->_configFile=realpath($configFile))===false || !is_file($this->_configFile)) throw new TIOException('application_configfile_inexistent',$configFile); $this->_cacheFile=$cacheFile; // generates unique ID by hashing the configuration file path $this->_uniqueID=md5($this->_configFile); - Prado::setApplication($this); } @@ -230,8 +230,6 @@ class TApplication extends TComponent */ public function run() { - //init the error handlers - $this->applyDefaultExceptionHandlers(); try { $this->initApplication($this->_configFile,$this->_cacheFile); @@ -256,13 +254,6 @@ class TApplication extends TComponent } } - /** - * Sets up error handler to convert PHP errors into exceptions that can be caught. - */ - protected function applyDefaultExceptionHandlers() - { - } - /** * Completes current request processing. * This method can be used to exit the application lifecycles after finishing diff --git a/framework/core.php b/framework/core.php index b5aa701c..405e5574 100644 --- a/framework/core.php +++ b/framework/core.php @@ -425,7 +425,7 @@ class PradoBase { if(self::$_application!==null && ($errorHandler=self::$_application->getErrorHandler())!==null) { - $errorHandler->handleError($exception); + $errorHandler->handleError(null,$exception); } else { diff --git a/framework/prado.php b/framework/prado.php index 9a83518c..ed6a4f49 100644 --- a/framework/prado.php +++ b/framework/prado.php @@ -44,11 +44,13 @@ if(!function_exists('__autoload')) } } -//Error handlers are set during TApplication::run(), -//Exception stack is empty if set error handlers requires TApplication -//and TApplication then causes an exception during instantiation. -//see TApplication::initDefaultExceptionHandlers() +/** + * Sets error handler to be Prado::phpErrorHandler + */ set_error_handler(array('Prado','phpErrorHandler'),error_reporting()); +/** + * Sets exception handler to be Prado::exceptionHandler + */ set_exception_handler(array('Prado','exceptionHandler')); /** -- cgit v1.2.3