Elgg
Version 1.9
|
Public Member Functions | |
start () | |
Starts the session. More... | |
isStarted () | |
Checks if the session is started. More... | |
getId () | |
Returns the session ID. More... | |
setId ($id) | |
Sets the session ID. More... | |
getName () | |
Returns the session name. More... | |
setName ($name) | |
Sets the session name. More... | |
regenerate ($destroy=false, $lifetime=null) | |
Regenerates id that represents this storage. More... | |
save () | |
Force the session to be saved and closed. More... | |
has ($name) | |
Checks if an attribute is defined. More... | |
get ($name, $default=null) | |
Returns an attribute. More... | |
set ($name, $value) | |
Sets an attribute. More... | |
all () | |
Returns all attributes. More... | |
replace (array $attributes) | |
Replaces all attributes. More... | |
remove ($name) | |
Removes an attribute. More... | |
clear () | |
Clears all attributes. More... | |
Definition at line 34 of file SessionStorage.php.
Elgg_Http_SessionStorage::all | ( | ) |
Returns all attributes.
Implemented in Elgg_Http_NativeSessionStorage, and Elgg_Http_MockSessionStorage.
Elgg_Http_SessionStorage::clear | ( | ) |
Clears all attributes.
Implemented in Elgg_Http_NativeSessionStorage, and Elgg_Http_MockSessionStorage.
Elgg_Http_SessionStorage::get | ( | $name, | |
$default = null |
|||
) |
Returns an attribute.
string | $name | The attribute name |
mixed | $default | The default value if not found. |
Implemented in Elgg_Http_NativeSessionStorage, and Elgg_Http_MockSessionStorage.
Elgg_Http_SessionStorage::getId | ( | ) |
Returns the session ID.
Implemented in Elgg_Http_NativeSessionStorage, and Elgg_Http_MockSessionStorage.
Elgg_Http_SessionStorage::getName | ( | ) |
Returns the session name.
Implemented in Elgg_Http_NativeSessionStorage, and Elgg_Http_MockSessionStorage.
Elgg_Http_SessionStorage::has | ( | $name | ) |
Checks if an attribute is defined.
string | $name | The attribute name |
Implemented in Elgg_Http_NativeSessionStorage, and Elgg_Http_MockSessionStorage.
Elgg_Http_SessionStorage::isStarted | ( | ) |
Checks if the session is started.
Implemented in Elgg_Http_NativeSessionStorage, and Elgg_Http_MockSessionStorage.
Elgg_Http_SessionStorage::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. |
RuntimeException | If an error occurs while regenerating this storage |
Implemented in Elgg_Http_NativeSessionStorage, and Elgg_Http_MockSessionStorage.
Elgg_Http_SessionStorage::remove | ( | $name | ) |
Removes an attribute.
string | $name | Attribute name |
Implemented in Elgg_Http_NativeSessionStorage, and Elgg_Http_MockSessionStorage.
Elgg_Http_SessionStorage::replace | ( | array | $attributes | ) |
Replaces all attributes.
array | $attributes | Attributes |
Implemented in Elgg_Http_NativeSessionStorage, and Elgg_Http_MockSessionStorage.
Elgg_Http_SessionStorage::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.
RuntimeException | If the session is saved without being started, or if the session is already closed. |
Implemented in Elgg_Http_NativeSessionStorage, and Elgg_Http_MockSessionStorage.
Elgg_Http_SessionStorage::set | ( | $name, | |
$value | |||
) |
Sets an attribute.
string | $name | Attribute name |
mixed | $value | Attribute value |
Implemented in Elgg_Http_NativeSessionStorage, and Elgg_Http_MockSessionStorage.
Elgg_Http_SessionStorage::setId | ( | $id | ) |
Sets the session ID.
string | $id | Session string |
Implemented in Elgg_Http_NativeSessionStorage, and Elgg_Http_MockSessionStorage.
Elgg_Http_SessionStorage::setName | ( | $name | ) |
Sets the session name.
string | $name | Session name. |
Implemented in Elgg_Http_NativeSessionStorage, and Elgg_Http_MockSessionStorage.
Elgg_Http_SessionStorage::start | ( | ) |
Starts the session.
RuntimeException | If something goes wrong starting the session. |
Implemented in Elgg_Http_NativeSessionStorage, and Elgg_Http_MockSessionStorage.