Class Zend_Session_Namespace

Description

Implements interfaces:

  • IteratorAggregate (internal interface)

Zend_Session_Namespace

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Session/Namespace.php (line 44)

Zend_Session_Abstract
   |
   --Zend_Session_Namespace
Class Constant Summary
Variable Summary
 static array $_namespaceLocks
 static array $_singleInstances
 string $_namespace
Method Summary
 static null resetSingleInstance ([string $namespaceName = null])
 static void unlockAll ()
 void __construct ([string $namespace = 'Default'], [bool $singleInstance = false])
 void apply (string|array $callback)
 void applySet (string|array $callback)
 ArrayObject getIterator ()
 string getNamespace ()
 bool isLocked ()
 void lock ()
 void setExpirationHops (int $hops, [mixed $variables = null], [boolean $hopCountOnUsageOnly = false])
 void setExpirationSeconds (int $seconds, [mixed $variables = null])
 void unlock ()
 true unsetAll ()
 mixed &__get (string $name)
 bool __isset (string $name)
 true __set (string $name, mixed $value)
 true __unset (string $name)
Variables
static array $_namespaceLocks = array() (line 64)

Namespace locking mechanism

  • access: protected
static array $_singleInstances = array() (line 71)

Single instance namespace array to ensure data security.

  • access: protected
string $_namespace = "Default" (line 57)

Namespace - which namespace this instance of zend-session is saving-to/getting-from

  • access: protected

Inherited Variables

Inherited from Zend_Session_Abstract

Zend_Session_Abstract::$_expiringData
Zend_Session_Abstract::$_readable
Zend_Session_Abstract::$_writable
Methods
static resetSingleInstance (line 79)

resetSingleInstance()

  • access: public
static null resetSingleInstance ([string $namespaceName = null])
  • string $namespaceName
static unlockAll (line 243)

unlockAll() - unmark all session/namespaces to enable read & write

  • access: public
static void unlockAll ()
Constructor __construct (line 102)

__construct() - Returns an instance object bound to a particular, isolated section of the session, identified by $namespace name (defaulting to 'Default').

The optional argument $singleInstance will prevent construction of additional instance objects acting as accessors to this $namespace.

  • access: public
void __construct ([string $namespace = 'Default'], [bool $singleInstance = false])
  • string $namespace:
    • programmatic name of the requested namespace
  • bool $singleInstance:
    • prevent creation of additional accessor instance objects for this namespace
apply (line 342)

apply() - enables applying user-selected function, such as array_merge() to the namespace Parameters following the $callback argument are passed to the callback function.

Caveat: ignores members expiring now.

Example: $namespace->apply('array_merge', array('tree' => 'apple', 'fruit' => 'peach'), array('flower' => 'rose')); $namespace->apply('count');

  • access: public
void apply (string|array $callback)
  • string|array $callback: - callback function
applySet (line 361)

applySet() - enables applying user-selected function, and sets entire namespace to the result Result of $callback must be an array.

Parameters following the $callback argument are passed to the callback function. Caveat: ignores members expiring now.

Example: $namespace->applySet('array_merge', array('tree' => 'apple', 'fruit' => 'peach'), array('flower' => 'rose'));

  • access: public
void applySet (string|array $callback)
  • string|array $callback: - callback function
getIterator (line 210)

getIterator() - return an iteratable object for use in foreach and the like, this completes the IteratorAggregate interface

  • return: - iteratable container of the namespace contents
  • access: public
ArrayObject getIterator ()

Implementation of:
IteratorAggregate::getIterator
getNamespace (line 525)

Returns the namespace name

  • access: public
string getNamespace ()
isLocked (line 254)

isLocked() - return lock status, true if, and only if, read-only

  • access: public
bool isLocked ()
lock (line 221)

lock() - mark a session/namespace as readonly

  • access: public
void lock ()
setExpirationHops (line 475)

setExpirationHops() - expire the namespace, or specific variables after a specified number of page hops

  • throws: Zend_Session_Exception
  • access: public
void setExpirationHops (int $hops, [mixed $variables = null], [boolean $hopCountOnUsageOnly = false])
  • int $hops:
    • how many "hops" (number of subsequent requests) before expiring
  • mixed $variables: - OPTIONAL list of variables to expire (defaults to all)
  • boolean $hopCountOnUsageOnly: - OPTIONAL if set, only count a hop/request if this namespace is used
setExpirationSeconds (line 427)

setExpirationSeconds() - expire the namespace, or specific variables after a specified number of seconds

  • throws: Zend_Session_Exception
  • access: public
void setExpirationSeconds (int $seconds, [mixed $variables = null])
  • int $seconds:
    • expires in this many seconds
  • mixed $variables: - OPTIONAL list of variables to expire (defaults to all)
unlock (line 232)

unlock() - unmark a session/namespace to enable read & write

  • access: public
void unlock ()
unsetAll (line 265)

unsetAll() - unset all variables in this namespace

  • access: public
true unsetAll ()
__get (line 277)

__get() - method to get a variable in this object's current namespace

  • access: public
mixed &__get (string $name)
  • string $name: - programmatic name of a key, in a <key,value> pair in the current namespace
__isset (line 384)

__isset() - determine if a variable in this object's namespace is set

  • access: public
bool __isset (string $name)
  • string $name: - programmatic name of a key, in a <key,value> pair in the current namespace
__set (line 299)

__set() - method to set a variable/value in this object's namespace

  • throws: Zend_Session_Exception
  • access: public
true __set (string $name, mixed $value)
  • string $name: - programmatic name of a key, in a <key,value> pair in the current namespace
  • mixed $value: - value in the <key,value> pair to assign to the $name key
__unset (line 404)

__unset() - unset a variable in this object's namespace.

  • access: public
true __unset (string $name)
  • string $name: - programmatic name of a key, in a <key,value> pair in the current namespace

Inherited Methods

Inherited From Zend_Session_Abstract

 Zend_Session_Abstract::_namespaceGet()
 Zend_Session_Abstract::_namespaceGetAll()
 Zend_Session_Abstract::_namespaceIsset()
 Zend_Session_Abstract::_namespaceUnset()
Class Constants
SINGLE_INSTANCE = true (line 50)

used as option to constructor to prevent additional instances to the same namespace

Inherited Constants

Inherited from Zend_Session_Abstract

Zend_Session_Abstract::_THROW_NOT_READABLE_MSG
Zend_Session_Abstract::_THROW_NOT_WRITABLE_MSG

Documentation generated on Mon, 21 Jun 2010 15:35:11 -0400 by phpDocumentor 1.4.3