Horde_Core_HashTable_PersistentSession
extends Horde_Core_HashTable_Vfs
in package
implements
Horde_Registry_Logout_Task
Hashtable implementation that ensures persistency of data within a given session, without using session storage. Instead, VFS is used to store the data.
The data is attempted to be removed at the end of the session, so there is no guarantee of persistence across sessions.
Tags
Table of Contents
Interfaces
- Horde_Registry_Logout_Task
- Interface to register a logout task.
Constants
- SESS_KEY = 'psession_keys'
- Session data storage key.
- VFS_PATH = '.horde/core/psession_data'
- The virtual path to use for VFS data (temporary storage).
Properties
- $_stream : bool
- Return get data as stream objects?
Methods
- __construct() : mixed
- gc() : mixed
- Perform garbage collection on the VFS path.
- getStream() : mixed
- Get data associated with a key(s).
- logoutTask() : mixed
- Function to run on logout.
- set() : mixed
- _get() : mixed
- _getKeys() : array<string|int, mixed>
- Return the list of keys that have been saved to VFS this session.
- _set() : mixed
Constants
SESS_KEY
Session data storage key.
public
mixed
SESS_KEY
= 'psession_keys'
VFS_PATH
The virtual path to use for VFS data (temporary storage).
public
mixed
VFS_PATH
= '.horde/core/psession_data'
Properties
$_stream
Return get data as stream objects?
protected
bool
$_stream
= \false
Methods
__construct()
public
__construct([array<string|int, mixed> $params = array() ]) : mixed
Parameters
- $params : array<string|int, mixed> = array()
gc()
Perform garbage collection on the VFS path.
public
gc(int $expire) : mixed
Parameters
- $expire : int
-
Expire entries older than this value (in seconds).
getStream()
Get data associated with a key(s).
public
getStream(mixed $keys) : mixed
Parameters
- $keys : mixed
-
The key or an array of keys.
Return values
mixed —The string/array on success (return type is the type of $keys); Horde_Stream objects are returned on success, false value(s) on failure.
logoutTask()
Function to run on logout.
public
logoutTask() : mixed
set()
public
set(mixed $key, mixed $val[, array<string|int, mixed> $opts = array() ]) : mixed
Parameters
- $key : mixed
- $val : mixed
- $opts : array<string|int, mixed> = array()
_get()
protected
_get(mixed $keys) : mixed
Parameters
- $keys : mixed
_getKeys()
Return the list of keys that have been saved to VFS this session.
protected
_getKeys() : array<string|int, mixed>
Return values
array<string|int, mixed> —List of keys.
_set()
protected
_set(mixed $key, mixed $val, array<string|int, mixed> $opts) : mixed
Parameters
- $key : mixed
- $val : mixed
- $opts : array<string|int, mixed>
-
Additional option honored in this driver:
- filename: (boolean) If true, $val is a filename containing the data to be saved rather than the data itself.