PHP Class lithium\storage\session\adapter\Memory

Inheritance: extends lithium\core\Object
Show file Open project: unionofrad/lithium Class Usage Examples

Public Properties

Property Type Description
$_session Holds the array that corresponds to session keys & values.

Public Methods

Method Description
check ( string $key, array $options = [] ) : Closure Checks if a value has been set in the session.
clear ( array $options = [] ) : Closure Clears all keys from the session.
delete ( string $key, array $options = [] ) : Closure Delete value from the session
enabled ( ) : boolean This adapter is always enabled, as it has no external dependencies.
isStarted ( ) : boolean The memory adapter session is always "on".
key ( ) : string Obtain the session key.
read ( null | string $key = null, array $options = [] ) : Closure Read a value from the session.
write ( string $key, mixed $value, array $options = [] ) : Closure Write a value to the session.

Method Details

check() public method

Checks if a value has been set in the session.
public check ( string $key, array $options = [] ) : Closure
$key string Key of the entry to be checked.
$options array Options array. Not used for this adapter method.
return Closure Function returning boolean `true` if the key exists, `false` otherwise.

clear() public method

Clears all keys from the session.
public clear ( array $options = [] ) : Closure
$options array Options array. Not used for this adapter method.
return Closure Function that clears the session

delete() public method

Delete value from the session
public delete ( string $key, array $options = [] ) : Closure
$key string The key to be deleted
$options array Options array. Not used for this adapter method.
return Closure Function returning boolean `true` on successful delete, `false` otherwise

enabled() public static method

This adapter is always enabled, as it has no external dependencies.
public static enabled ( ) : boolean
return boolean True

isStarted() public method

The memory adapter session is always "on".
public isStarted ( ) : boolean
return boolean True.

key() public static method

For this adapter, it is a UUID.
public static key ( ) : string
return string UUID.

read() public method

Read a value from the session.
public read ( null | string $key = null, array $options = [] ) : Closure
$key null | string Key of the entry to be read. If no key is passed, all current session data is returned.
$options array Options array. Not used for this adapter method.
return Closure Function returning data in the session if successful, `false` otherwise.

write() public method

Write a value to the session.
public write ( string $key, mixed $value, array $options = [] ) : Closure
$key string Key of the item to be stored.
$value mixed The value to be stored.
$options array Options array. Not used for this adapter method.
return Closure Function returning boolean `true` on successful write, `false` otherwise.

Property Details

$_session public property

Holds the array that corresponds to session keys & values.
public $_session