From 1f19172f3df377ca0e88bb230d6f374ebef41b91 Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 8 Feb 2006 21:06:54 +0000 Subject: Moved onExitApplication out of destructor. --- demos/personal/protected/application.xml | 2 +- framework/TApplication.php | 13 +++---------- framework/Web/THttpResponse.php | 1 + 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/demos/personal/protected/application.xml b/demos/personal/protected/application.xml index 4c26afec..0e6bd313 100644 --- a/demos/personal/protected/application.xml +++ b/demos/personal/protected/application.xml @@ -11,7 +11,7 @@ --> - + diff --git a/framework/TApplication.php b/framework/TApplication.php index 7118fc54..151ff803 100644 --- a/framework/TApplication.php +++ b/framework/TApplication.php @@ -85,7 +85,8 @@ require_once(PRADO_DIR.'/Web/Services/TPageService.php'); * - PostRunService : this event happens right after the requested service finishes running * - SaveState : this event happens when application needs to save its state * - PostSaveState : this event happens right after the application saves its state - * - EndRequest : this is the last stage an application runs + * - EndRequest : this is the last stage a request is being completed + * - ExitApplication : this is the last stage before application instance is destructed * - [destruct] : destruction of the application instance * Modules and services can attach their methods to one or several of the above * events and do appropriate processing when the events are raised. By this way, @@ -313,15 +314,6 @@ class TApplication extends TComponent $this->_uniqueID=md5($this->_runtimePath); } - /** - * Destructor. - * It invokes {@link onExitApplication} method. - */ - public function __destruct() - { - $this->onExitApplication(); - } - /** * Executes the lifecycles of the application. * This is the main entry function that leads to the running of the whole @@ -352,6 +344,7 @@ class TApplication extends TComponent { $this->onError($e); } + $this->onExitApplication(); } /** diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php index d51c0cf2..1cbf9751 100644 --- a/framework/Web/THttpResponse.php +++ b/framework/Web/THttpResponse.php @@ -265,6 +265,7 @@ class THttpResponse extends TModule implements ITextWriter */ public function redirect($url) { + $this->getApplication()->onExitApplication(); header('Location:'.$url); exit(); } -- cgit v1.2.3