diff options
author | xue <> | 2005-12-28 20:17:54 +0000 |
---|---|---|
committer | xue <> | 2005-12-28 20:17:54 +0000 |
commit | e8b60312037e54c34a06d6f57d7c21946cf3cd1f (patch) | |
tree | a6f35f5d4bb921998ca306602a33fc03ba47c4b5 /framework/Exceptions/TErrorHandler.php | |
parent | 930c51a6d618d487105cd46c517f36c3b1fe3b44 (diff) |
Modified the way to access application singleton.
IService and IModule interfaces are also adjusted accordingly.
Diffstat (limited to 'framework/Exceptions/TErrorHandler.php')
-rw-r--r-- | framework/Exceptions/TErrorHandler.php | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/framework/Exceptions/TErrorHandler.php b/framework/Exceptions/TErrorHandler.php index ca42c8ff..c8137a09 100644 --- a/framework/Exceptions/TErrorHandler.php +++ b/framework/Exceptions/TErrorHandler.php @@ -65,10 +65,6 @@ class TErrorHandler extends TModule const SOURCE_LINES=12;
/**
- * @var TApplication application instance
- */
- private $_application;
- /**
* @var string error template directory
*/
private $_templatePath=null;
@@ -76,15 +72,13 @@ class TErrorHandler extends TModule /**
* Initializes the module.
* This method is required by IModule and is invoked by application.
- * @param TApplication application
* @param TXmlElement module configuration
*/
- public function init($application,$config)
+ public function init($config=null)
{
- parent::init($application,$config);
+ parent::init($config);
- $this->_application=$application;
- $application->setErrorHandler($this);
+ $this->getApplication()->setErrorHandler($this);
}
/**
@@ -132,13 +126,13 @@ class TErrorHandler extends TModule else
{
$handling=true;
- if(($response=Prado::getApplication()->getResponse())!==null)
+ if(($response=$this->getResponse())!==null)
$response->clear();
if(!headers_sent())
header('Content-Type: text/html; charset=UTF-8');
if($param instanceof THttpException)
$this->handleExternalError($param->getStatusCode(),$param);
- else if(Prado::getApplication()->getMode()===TApplication::STATE_DEBUG)
+ else if($this->getApplication()->getMode()===TApplication::STATE_DEBUG)
$this->displayException($param);
else
$this->handleExternalError(500,$param);
@@ -192,7 +186,7 @@ class TErrorHandler extends TModule */
protected function handleRecursiveError($exception)
{
- if(Prado::getApplication()->getMode()===TApplication::STATE_DEBUG)
+ if($this->getApplication()->getMode()===TApplication::STATE_DEBUG)
{
echo "<html><head><title>Recursive Error</title></head>\n";
echo "<body><h1>Recursive Error</h1>\n";
|