|
Elgg
Version 1.10
|
Public Member Functions | |||||||||
| __construct ($name='MOCKSESSID') | |||||||||
| Constructor. More... | |||||||||
| start () | |||||||||
{Starts the session.
| |||||||||
| regenerate ($destroy=false, $lifetime=null) | |||||||||
{Regenerates id that represents this storage.This method must invoke session_regenerate_id($destroy) unless this interface is used for a storage object designed for unit or functional testing where a real PHP session would interfere with testing.Note regenerate+destroy should not clear the session data in memory only delete the session data from persistent storage.
| |||||||||
| save () | |||||||||
{Force the session to be saved and closed.This method must invoke session_write_close() unless this interface is used for a storage object design for unit or functional testing where a real PHP session would interfere with testing, in which case it it should actually persist the session data if required.
| |||||||||
| isStarted () | |||||||||
{Checks if the session is started.
| |||||||||
| getId () | |||||||||
{Returns the session ID.
| |||||||||
| setId ($id) | |||||||||
{Sets the session ID.
| |||||||||
| getName () | |||||||||
{Returns the session name.
| |||||||||
| setName ($name) | |||||||||
{Sets the session name.
| |||||||||
| has ($name) | |||||||||
{Checks if an attribute is defined.
| |||||||||
| get ($name, $default=null) | |||||||||
{Returns an attribute.
| |||||||||
| set ($name, $value) | |||||||||
{Sets an attribute.
| |||||||||
| all () | |||||||||
{Returns all attributes.
| |||||||||
| replace (array $attributes) | |||||||||
{Replaces all attributes.
| |||||||||
| remove ($name) | |||||||||
{Removes an attribute.
| |||||||||
| clear () | |||||||||
{Clears all attributes.
| |||||||||
Protected Member Functions | |
| generateId () | |
| Generates a session ID. More... | |
Protected Attributes | |
| $started = false | |
| $closed = false | |
| $id = '' | |
| $name | |
| $data = array() | |
Definition at line 36 of file MockSessionStorage.php.
| Elgg\Http\MockSessionStorage::__construct | ( | $name = 'MOCKSESSID' | ) |
Constructor.
| string | $name | Session name |
Definition at line 58 of file MockSessionStorage.php.
| Elgg\Http\MockSessionStorage::all | ( | ) |
{Returns all attributes.
Implements Elgg\Http\SessionStorage.
Definition at line 187 of file MockSessionStorage.php.
| Elgg\Http\MockSessionStorage::clear | ( | ) |
{Clears all attributes.
Implements Elgg\Http\SessionStorage.
Definition at line 226 of file MockSessionStorage.php.
|
protected |
Generates a session ID.
This doesn't need to be particularly cryptographically secure since this is just a mock.
Definition at line 150 of file MockSessionStorage.php.
| Elgg\Http\MockSessionStorage::get | ( | $name, | |
$default = null |
|||
| ) |
{Returns an attribute.
| string | $name | The attribute name |
| mixed | $default | The default value if not found. |
Implements Elgg\Http\SessionStorage.
Definition at line 167 of file MockSessionStorage.php.
| Elgg\Http\MockSessionStorage::getId | ( | ) |
{Returns the session ID.
Implements Elgg\Http\SessionStorage.
Definition at line 113 of file MockSessionStorage.php.
| Elgg\Http\MockSessionStorage::getName | ( | ) |
{Returns the session name.
Implements Elgg\Http\SessionStorage.
Definition at line 131 of file MockSessionStorage.php.
| Elgg\Http\MockSessionStorage::has | ( | $name | ) |
{Checks if an attribute is defined.
| string | $name | The attribute name |
Implements Elgg\Http\SessionStorage.
Definition at line 157 of file MockSessionStorage.php.
| Elgg\Http\MockSessionStorage::isStarted | ( | ) |
{Checks if the session is started.
Implements Elgg\Http\SessionStorage.
Definition at line 106 of file MockSessionStorage.php.
| Elgg\Http\MockSessionStorage::regenerate | ( | $destroy = false, |
|
$lifetime = null |
|||
| ) |
{Regenerates id that represents this storage.This method must invoke session_regenerate_id($destroy) unless this interface is used for a storage object designed for unit or functional testing where a real PHP session would interfere with testing.Note regenerate+destroy should not clear the session data in memory only delete the session data from persistent storage.
| boolean | $destroy | Destroy session when regenerating? |
| integer | $lifetime | Sets the cookie lifetime for the session cookie. A null value will leave the system settings unchanged, 0 sets the cookie to expire with browser session. Time is in seconds, and is not a Unix timestamp. |
Implements Elgg\Http\SessionStorage.
Definition at line 83 of file MockSessionStorage.php.
| Elgg\Http\MockSessionStorage::remove | ( | $name | ) |
{Removes an attribute.
| string | $name | Attribute name |
Implements Elgg\Http\SessionStorage.
Definition at line 210 of file MockSessionStorage.php.
| Elgg\Http\MockSessionStorage::replace | ( | array | $attributes | ) |
{Replaces all attributes.
| array | $attributes | Attributes |
Implements Elgg\Http\SessionStorage.
Definition at line 197 of file MockSessionStorage.php.
| Elgg\Http\MockSessionStorage::save | ( | ) |
{Force the session to be saved and closed.This method must invoke session_write_close() unless this interface is used for a storage object design for unit or functional testing where a real PHP session would interfere with testing, in which case it it should actually persist the session data if required.
Implements Elgg\Http\SessionStorage.
Definition at line 96 of file MockSessionStorage.php.
| Elgg\Http\MockSessionStorage::set | ( | $name, | |
| $value | |||
| ) |
{Sets an attribute.
| string | $name | Attribute name |
| mixed | $value | Attribute value |
Implements Elgg\Http\SessionStorage.
Definition at line 177 of file MockSessionStorage.php.
| Elgg\Http\MockSessionStorage::setId | ( | $id | ) |
{Sets the session ID.
| string | $id | Session string |
Implements Elgg\Http\SessionStorage.
Definition at line 120 of file MockSessionStorage.php.
| Elgg\Http\MockSessionStorage::setName | ( | $name | ) |
{Sets the session name.
| string | $name | Session name. |
Implements Elgg\Http\SessionStorage.
Definition at line 138 of file MockSessionStorage.php.
| Elgg\Http\MockSessionStorage::start | ( | ) |
{Starts the session.
Implements Elgg\Http\SessionStorage.
Definition at line 65 of file MockSessionStorage.php.
|
protected |
Definition at line 42 of file MockSessionStorage.php.
|
protected |
Definition at line 51 of file MockSessionStorage.php.
|
protected |
Definition at line 45 of file MockSessionStorage.php.
|
protected |
Definition at line 48 of file MockSessionStorage.php.
|
protected |
Definition at line 39 of file MockSessionStorage.php.