Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Zend_Session_Namespace
SINGLE_INSTANCE = 'true'
used as option to constructor to prevent additional instances to the same namespace
Detailsstring $_namespace = 'Default'Namespace - which namespace this instance of zend-session is saving-to/getting-from
Detailsarray $_namespaceLocks = 'array'Namespace locking mechanism
Detailsarray $_singleInstances = 'array'Single instance namespace array to ensure data security.
Details__construct(
string $namespace
=
Default, bool $singleInstance
=
false
)
:
void__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.
Details__get(
string $name
)
:
mixed__get() - method to get a variable in this object's current namespace
Details__isset(
string $name
)
:
bool__isset() - determine if a variable in this object's namespace is set
Details__set(
string $name, mixed $value
)
:
true__set() - method to set a variable/value in this object's namespace
Details__unset(
string $name
)
:
true__unset() - unset a variable in this object's namespace.
Detailsapply(
string|array $callback
)
:
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');
DetailsapplySet(
string|array $callback
)
:
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'));
DetailsgetIterator(
)
:
ArrayObjectgetIterator() - return an iteratable object for use in foreach and the like, this completes the IteratorAggregate interface
DetailsgetNamespace(
)
:
stringReturns the namespace name
DetailsisLocked(
)
:
boolisLocked() - return lock status, true if, and only if, read-only
Detailslock(
)
:
voidlock() - mark a session/namespace as readonly
DetailsresetSingleInstance(
string $namespaceName
=
null
)
:
nullresetSingleInstance()
DetailssetExpirationHops(
int $hops, mixed $variables
=
null, boolean $hopCountOnUsageOnly
=
false
)
:
voidsetExpirationHops() - expire the namespace, or specific variables after a specified number of page hops
DetailssetExpirationSeconds(
int $seconds, mixed $variables
=
null
)
:
voidsetExpirationSeconds() - expire the namespace, or specific variables after a specified number of seconds
Detailsunlock(
)
:
voidunlock() - unmark a session/namespace to enable read & write
DetailsunlockAll(
)
:
voidunlockAll() - unmark all session/namespaces to enable read & write
DetailsunsetAll(
)
:
trueunsetAll() - unset all variables in this namespace
Details