From c62323a40a833d991c091f8cd99bf9a4f29bfc6c Mon Sep 17 00:00:00 2001 From: xue <> Date: Tue, 1 Aug 2006 12:27:41 +0000 Subject: Changed PHP minimum requirement to 5.1.0 --- framework/Web/THttpRequest.php | 12 +++++++++++- framework/Web/THttpSession.php | 15 +++++++++++++-- framework/Web/UI/TTemplateControl.php | 2 +- 3 files changed, 25 insertions(+), 4 deletions(-) (limited to 'framework/Web') diff --git a/framework/Web/THttpRequest.php b/framework/Web/THttpRequest.php index d251f6ab..130dc3cf 100644 --- a/framework/Web/THttpRequest.php +++ b/framework/Web/THttpRequest.php @@ -57,7 +57,7 @@ * @package System.Web * @since 3.0 */ -class THttpRequest extends TApplicationComponent implements IteratorAggregate,ArrayAccess,IModule +class THttpRequest extends TApplicationComponent implements IteratorAggregate,ArrayAccess,Countable,IModule { /** * Separator used to separate GET variable name and value when URL format is Path. @@ -660,6 +660,16 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar return count($this->_items); } + /** + * Returns the number of items in the request. + * This method is required by Countable interface. + * @return integer number of items in the request. + */ + public function count() + { + return $this->getCount(); + } + /** * @return array the key list */ diff --git a/framework/Web/THttpSession.php b/framework/Web/THttpSession.php index 4439cf57..19473cda 100644 --- a/framework/Web/THttpSession.php +++ b/framework/Web/THttpSession.php @@ -61,7 +61,7 @@ * @package System.Web * @since 3.0 */ -class THttpSession extends TApplicationComponent implements IteratorAggregate,ArrayAccess,IModule +class THttpSession extends TApplicationComponent implements IteratorAggregate,ArrayAccess,Countable,IModule { /** * @var boolean whether this module has been initialized @@ -139,7 +139,8 @@ class THttpSession extends TApplicationComponent implements IteratorAggregate,Ar session_set_save_handler(array($this,'_open'),array($this,'_close'),array($this,'_read'),array($this,'_write'),array($this,'_destroy'),array($this,'_gc')); if($this->_cookie!==null) session_set_cookie_params($this->_cookie->getExpire(),$this->_cookie->getPath(),$this->_cookie->getDomain(),$this->_cookie->getSecure()); - session_start(); + if(ini_get('session.auto_start')!=='1') + session_start(); $this->_started=true; } } @@ -486,6 +487,16 @@ class THttpSession extends TApplicationComponent implements IteratorAggregate,Ar return count($_SESSION); } + /** + * Returns the number of items in the session. + * This method is required by Countable interface. + * @return integer number of items in the session. + */ + public function count() + { + return $this->getCount(); + } + /** * @return array the list of session variable names */ diff --git a/framework/Web/UI/TTemplateControl.php b/framework/Web/UI/TTemplateControl.php index c7364d4b..3bbe52c5 100644 --- a/framework/Web/UI/TTemplateControl.php +++ b/framework/Web/UI/TTemplateControl.php @@ -129,7 +129,7 @@ class TTemplateControl extends TCompositeControl */ public function createChildControls() { - if($tpl=$this->getTemplate(true)) + if($tpl=$this->getTemplate()) { foreach($tpl->getDirective() as $name=>$value) { -- cgit v1.2.3