From b4e9f6795206fab6b952f814ccf812677a34c635 Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 7 Dec 2005 00:32:29 +0000 Subject: --- framework/Web/THttpRequest.php | 23 ++--------------------- framework/Web/THttpResponse.php | 25 +++---------------------- framework/Web/THttpSession.php | 24 +++--------------------- framework/Web/UI/TAssetManager.php | 24 +++--------------------- framework/Web/UI/TTemplateManager.php | 24 +++--------------------- framework/Web/UI/TThemeManager.php | 23 ++--------------------- 6 files changed, 16 insertions(+), 127 deletions(-) (limited to 'framework/Web') diff --git a/framework/Web/THttpRequest.php b/framework/Web/THttpRequest.php index 80e87d15..0c21a020 100644 --- a/framework/Web/THttpRequest.php +++ b/framework/Web/THttpRequest.php @@ -29,7 +29,7 @@ * @package System.Web * @since 3.0 */ -class THttpRequest extends TComponent implements IModule +class THttpRequest extends TModule { /** * GET variable name to store service information @@ -39,10 +39,6 @@ class THttpRequest extends TComponent implements IModule * @var boolean whether the module is initialized */ private $_initialized=false; - /** - * @var string module ID - */ - private $_id; /** * @var string requested service ID */ @@ -76,6 +72,7 @@ class THttpRequest extends TComponent implements IModule */ public function init($application,$config) { + parent::init($application,$config); // Info about server variables: // PHP_SELF contains real URI (w/ path info, w/o query string) // SCRIPT_NAME is the real URI for the requested script (w/o path info and query string) @@ -124,22 +121,6 @@ class THttpRequest extends TComponent implements IModule return is_array($data)?array_map(array($this,'stripSlashes'),$data):stripslashes($data); } - /** - * @return string id of this module - */ - public function getID() - { - return $this->_id; - } - - /** - * @param string id of this module - */ - public function setID($value) - { - $this->_id=$value; - } - /** * @return TUri the request URL */ diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php index dfa2d023..ad290fb0 100644 --- a/framework/Web/THttpResponse.php +++ b/framework/Web/THttpResponse.php @@ -37,12 +37,8 @@ * @package System.Web * @since 3.0 */ -class THttpResponse extends TComponent implements IModule, ITextWriter +class THttpResponse extends TModule implements ITextWriter { - /** - * @var string id of this module (response) - */ - private $_id; /** * @var boolean whether to buffer output */ @@ -84,29 +80,14 @@ class THttpResponse extends TComponent implements IModule, ITextWriter */ public function init($application,$config) { + parent::init($application,$config); + if($this->_bufferOutput) ob_start(); $this->_initialized=true; $application->setResponse($this); } - /** - * @return string id of this module - */ - public function getID() - { - return $this->_id; - } - - /** - * @param string id of this module - */ - public function setID($value) - { - $this->_id=$value; - } - - /** * @return integer time-to-live for cached session pages in minutes, this has no effect for nocache limiter. Defaults to 180. */ diff --git a/framework/Web/THttpSession.php b/framework/Web/THttpSession.php index 5afcfb7a..0698d4d8 100644 --- a/framework/Web/THttpSession.php +++ b/framework/Web/THttpSession.php @@ -54,12 +54,8 @@ * @package System.Web * @since 3.0 */ -class THttpSession extends TComponent implements IModule +class THttpSession extends TModule { - /** - * @var string ID of this module - */ - private $_id; /** * @var THttpSessionCollection list of session variables */ @@ -89,6 +85,8 @@ class THttpSession extends TComponent implements IModule */ public function init($application,$config) { + parent::init($application,$config); + if($this->_autoStart) session_start(); $this->_initialized=true; @@ -133,22 +131,6 @@ class THttpSession extends TComponent implements IModule } } - /** - * @return string the ID of this session module (not session ID) - */ - public function getID() - { - return $this->_id; - } - - /** - * @param string the ID of this session module (not session ID) - */ - public function setID($value) - { - $this->_id=$value; - } - /** * @return THttpSessionCollection list of session variables */ diff --git a/framework/Web/UI/TAssetManager.php b/framework/Web/UI/TAssetManager.php index 0f96ae90..df189b58 100644 --- a/framework/Web/UI/TAssetManager.php +++ b/framework/Web/UI/TAssetManager.php @@ -41,7 +41,7 @@ * @package System.Web.UI * @since 3.0 */ -class TAssetManager extends TComponent implements IModule +class TAssetManager extends TModule { /** * Default web accessible base path for storing private files @@ -55,10 +55,6 @@ class TAssetManager extends TComponent implements IModule * @var string base URL for accessing the publishing directory. */ private $_baseUrl=null; - /** - * @var string module ID - */ - private $_id='asset'; /** * @var boolean whether to use timestamp checking to ensure files are published with up-to-date versions. */ @@ -80,6 +76,8 @@ class TAssetManager extends TComponent implements IModule */ public function init($application,$config) { + parent::init($application,$config); + $this->_application=$application; if($this->_basePath===null) $this->_basePath=dirname($application->getRequest()->getPhysicalApplicationPath()).'/'.self::DEFAULT_BASEPATH; @@ -90,22 +88,6 @@ class TAssetManager extends TComponent implements IModule $application->getService()->setAssetManager($this); } - /** - * @return string id of this module - */ - public function getID() - { - return $this->_id; - } - - /** - * @param string id of this module - */ - public function setID($value) - { - $this->_id=$value; - } - /** * @return string the root directory storing published asset files */ diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php index 1f3044a2..6864e038 100644 --- a/framework/Web/UI/TTemplateManager.php +++ b/framework/Web/UI/TTemplateManager.php @@ -27,7 +27,7 @@ * @package System.Web.UI * @since 3.0 */ -class TTemplateManager extends TComponent implements IModule +class TTemplateManager extends TModule { /** * Template file extension @@ -41,10 +41,6 @@ class TTemplateManager extends TComponent implements IModule * @var TApplication application instance */ private $_application; - /** - * @var string module ID - */ - private $_id; /** * Initializes the module. @@ -55,26 +51,12 @@ class TTemplateManager extends TComponent implements IModule */ public function init($application,$config) { + parent::init($application,$config); + $this->_application=$application; $application->getService()->setTemplateManager($this); } - /** - * @return string id of this module - */ - public function getID() - { - return $this->_id; - } - - /** - * @param string id of this module - */ - public function setID($value) - { - $this->_id=$value; - } - /** * Loads the template corresponding to the specified class name. * @return ITemplate template for the class name, null if template doesn't exist. diff --git a/framework/Web/UI/TThemeManager.php b/framework/Web/UI/TThemeManager.php index 504e8ecb..746e36cb 100644 --- a/framework/Web/UI/TThemeManager.php +++ b/framework/Web/UI/TThemeManager.php @@ -36,16 +36,12 @@ * @package System.Web.UI * @since 3.0 */ -class TThemeManager extends TComponent implements IModule +class TThemeManager extends TModule { /** * default themes base path */ const DEFAULT_BASEPATH='themes'; - /** - * @var string module ID - */ - private $_id='theme'; /** * @var boolean whether this module has been initialized */ @@ -71,27 +67,12 @@ class TThemeManager extends TComponent implements IModule */ public function init($application,$config) { + parent::init($application,$config); $this->_application=$application; $this->_initialized=true; $application->getService()->setThemeManager($this); } - /** - * @return string id of this module - */ - public function getID() - { - return $this->_id; - } - - /** - * @param string id of this module - */ - public function setID($value) - { - $this->_id=$value; - } - /** * @param string name of the theme to be retrieved * @return TTheme the theme retrieved -- cgit v1.2.3