From 6c1b05deafd9940da5d473800032558df90b118e Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 16 Nov 2005 22:32:52 +0000 Subject: Key modules are now using registered to application rather than using reserved module names. --- framework/Web/Services/TPageService.php | 3 +-- framework/Web/THttpRequest.php | 45 +++++++++++++++++---------------- framework/Web/THttpResponse.php | 1 + framework/Web/THttpSession.php | 1 + 4 files changed, 26 insertions(+), 24 deletions(-) (limited to 'framework/Web') diff --git a/framework/Web/Services/TPageService.php b/framework/Web/Services/TPageService.php index f32e8ee7..0fb39dfb 100644 --- a/framework/Web/Services/TPageService.php +++ b/framework/Web/Services/TPageService.php @@ -165,8 +165,7 @@ class TPageService extends TComponent implements IService $module->init($this->_application,$moduleConfig[2]); } - if(($auth=$application->getAuthManager())!==null) - $auth->getAuthorizationRules()->mergeWith($pageConfig->getRules()); + $application->getAuthorizationRules()->mergeWith($pageConfig->getRules()); $this->_initialized=true; } diff --git a/framework/Web/THttpRequest.php b/framework/Web/THttpRequest.php index f87111ba..9be0db8a 100644 --- a/framework/Web/THttpRequest.php +++ b/framework/Web/THttpRequest.php @@ -67,6 +67,28 @@ class THttpRequest extends TComponent implements IModule * Analyzes and resolves user request. */ public function __construct() + { + } + + /** + * Strips slashes from input data. + * This method is applied when magic quotes is enabled. + * Do not call this method. + * @param mixed input data to be processed + * @param mixed processed data + */ + public function stripSlashes(&$data) + { + return is_array($data)?array_map(array($this,'stripSlashes'),$data):stripslashes($data); + } + + /** + * Initializes the module. + * This method is required by IModule and is invoked by application. + * @param IApplication application + * @param TXmlElement module configuration + */ + public function init($application,$config) { // Info about server variables: // PHP_SELF contains real URI (w/ path info, w/o query string) @@ -101,29 +123,8 @@ class THttpRequest extends TComponent implements IModule $this->_items=new TMap(array_merge($_POST,$_GET)); $this->resolveRequest(); - } - - /** - * Strips slashes from input data. - * This method is applied when magic quotes is enabled. - * Do not call this method. - * @param mixed input data to be processed - * @param mixed processed data - */ - public function stripSlashes(&$data) - { - return is_array($data)?array_map(array($this,'stripSlashes'),$data):stripslashes($data); - } - - /** - * Initializes the module. - * This method is required by IModule and is invoked by application. - * @param IApplication application - * @param TXmlElement module configuration - */ - public function init($application,$config) - { $this->_initialized=true; + $application->setRequest($this); } /** diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php index 4dd81868..777c6621 100644 --- a/framework/Web/THttpResponse.php +++ b/framework/Web/THttpResponse.php @@ -68,6 +68,7 @@ class THttpResponse extends TComponent implements IModule, ITextWriter if($this->_bufferOutput) ob_start(); $this->_initialized=true; + $application->setResponse($this); } /** diff --git a/framework/Web/THttpSession.php b/framework/Web/THttpSession.php index fc8f99c6..ff3af560 100644 --- a/framework/Web/THttpSession.php +++ b/framework/Web/THttpSession.php @@ -79,6 +79,7 @@ class THttpSession extends TComponent implements IModule if($this->_autoStart) session_start(); $this->_initialized=true; + $application->setSession($this); } /** -- cgit v1.2.3