diff options
author | xue <> | 2006-08-02 02:24:29 +0000 |
---|---|---|
committer | xue <> | 2006-08-02 02:24:29 +0000 |
commit | 550ba06593b467b643862d41a00ca2dd12ee704b (patch) | |
tree | 16ad8180c2f0b96454453effff89dc236469ee4f /framework/Web/THttpSession.php | |
parent | ccfa7850dc435ae9941cde18be827b3aac550f85 (diff) |
merge from 3.0 branch till 1320.
Diffstat (limited to 'framework/Web/THttpSession.php')
-rw-r--r-- | framework/Web/THttpSession.php | 15 |
1 files changed, 13 insertions, 2 deletions
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;
}
}
@@ -487,6 +488,16 @@ class THttpSession extends TApplicationComponent implements IteratorAggregate,Ar }
/**
+ * 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
*/
public function getKeys()
|