API Documentation

Session/Namespace.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Session
since
Preview Release 0.2
version
$Id: Namespace.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Session_Namespace

Description

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

Extends from
Zend_Session_Abstract
Implements
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Session
Constants
SINGLE_INSTANCE
Properties
$_namespace
$_namespaceLocks
$_singleInstances
Methods
resetSingleInstance
__construct
getIterator
lock
unlock
unlockAll
isLocked
unsetAll
__get
__set
apply
applySet
__isset
__unset
setExpirationSeconds
setExpirationHops
getNamespace

Description

Zend_Session_Namespace

Constants

SINGLE_INSTANCE

 SINGLE_INSTANCE = 'true'

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

Details

value
true

Properties

$_namespace

string $_namespace = 'Default'

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

Details

$_namespace
string
visibility
protected
default
Default
final
false
static
false

$_namespaceLocks

array $_namespaceLocks = 'array'

Namespace locking mechanism

Details

$_namespaceLocks
array
visibility
protected
default
array
final
false
static
true

$_singleInstances

array $_singleInstances = 'array'

Single instance namespace array to ensure data security.

Details

$_singleInstances
array
visibility
protected
default
array
final
false
static
true

Methods

__construct

__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.

Arguments
$namespace
string
- programmatic name of the requested namespace
$singleInstance
bool
- prevent creation of additional accessor instance objects for this namespace
Details
visibility
public
final
false
static
false

__get

__get( string $name ) : mixed

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

Arguments
$name
string
- programmatic name of a key, in a <key,value> pair in the current namespace
Output
mixed
Details
visibility
public
final
false
static
false

__isset

__isset( string $name ) : bool

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

Arguments
$name
string
- programmatic name of a key, in a <key,value> pair in the current namespace
Output
bool
Details
visibility
public
final
false
static
false

__set

__set( string $name, mixed $value ) : true

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

Arguments
$name
string
- programmatic name of a key, in a <key,value> pair in the current namespace
$value
mixed
- value in the <key,value> pair to assign to the $name key
Output
true
Details
visibility
public
final
false
static
false
throws

__unset

__unset( string $name ) : true

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

Arguments
$name
string
- programmatic name of a key, in a <key,value> pair in the current namespace
Output
true
Details
visibility
public
final
false
static
false

apply

apply( 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');

Arguments
$callback
stringarray
- callback function
Details
visibility
public
final
false
static
false

applySet

applySet( 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'));

Arguments
$callback
stringarray
- callback function
Details
visibility
public
final
false
static
false

getIterator

getIterator( ) : ArrayObject

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

Output
ArrayObject
- iteratable container of the namespace contents
Details
visibility
public
final
false
static
false

getNamespace

getNamespace( ) : string

Returns the namespace name

Output
string
Details
visibility
public
final
false
static
false

isLocked

isLocked( ) : bool

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

Output
bool
Details
visibility
public
final
false
static
false

lock

lock( ) : void

lock() - mark a session/namespace as readonly

Details
visibility
public
final
false
static
false

resetSingleInstance

resetSingleInstance( string $namespaceName = null ) : null

resetSingleInstance()

Arguments
$namespaceName
string
Output
null
Details
visibility
public
final
false
static
true

setExpirationHops

setExpirationHops( int $hops, mixed $variables = null, boolean $hopCountOnUsageOnly = false ) : void

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

Arguments
$hops
int
- how many "hops" (number of subsequent requests) before expiring
$variables
mixed
- OPTIONAL list of variables to expire (defaults to all)
$hopCountOnUsageOnly
boolean
- OPTIONAL if set, only count a hop/request if this namespace is used
Details
visibility
public
final
false
static
false
throws

setExpirationSeconds

setExpirationSeconds( int $seconds, mixed $variables = null ) : void

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

Arguments
$seconds
int
- expires in this many seconds
$variables
mixed
- OPTIONAL list of variables to expire (defaults to all)
Details
visibility
public
final
false
static
false
throws

unlock

unlock( ) : void

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

Details
visibility
public
final
false
static
false

unlockAll

unlockAll( ) : void

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

Details
visibility
public
final
false
static
true

unsetAll

unsetAll( ) : true

unsetAll() - unset all variables in this namespace

Output
true
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.