Base class for all sfStorage that uses a sfDatabase object as a storage.
Method Summary
initialize , read , regenerate , remove , shutdown , write
Methods inherited from sfStorage
getOptions , initialize , read , regenerate , remove , shutdown , write , __construct
Method Details
-
initialize ($options = array())
Browse code
| $options |
An associative array of options
|
Available options:
* db_table: The database table in which session data will be stored
* database: The sfDatabase object to use
* db_id_col: The database column in which the session id will be stored (sess_id by default)
* db_data_col: The database column in which the session data will be stored (sess_data by default)
* db_time_col: The database column in which the session timestamp will be stored (sess_time by default)
-
(boolean) regenerate ($destroy = false)
Browse code
| $destroy |
Destroy session when regenerating?
|
Regenerates id that represents this storage.
returns True if session regenerated, false if error
-
(boolean) sessionClose ()
Browse code
Closes a session.
returns true, if the session was closed, otherwise false
-
(bool) sessionDestroy ($id)
Browse code
Destroys a session.
returns true, if the session was destroyed, otherwise an exception is thrown
throws DatabaseException If the session cannot be destroyed
-
(bool) sessionGC ($lifetime)
Browse code
| $lifetime |
The lifetime of a session
|
Cleans up old sessions.
returns true, if old sessions have been cleaned, otherwise an exception is thrown
throws DatabaseException If any old sessions cannot be cleaned
-
(boolean) sessionOpen ($path = null, $name = null)
Browse code
| $path |
(ignored)
|
| $name |
(ignored)
|
Opens a session.
returns true, if the session was opened, otherwise an exception is thrown
throws DatabaseException If a connection with the database does not exist or cannot be created
-
(bool) sessionRead ($id)
Browse code
Reads a session.
returns true, if the session was read, otherwise an exception is thrown
throws DatabaseException If the session cannot be read
-
(bool) sessionWrite ($id, $data)
Browse code
| $id |
A session ID
|
| $data |
A serialized chunk of session data
|
Writes session data.
returns true, if the session was written, otherwise an exception is thrown
throws DatabaseException If the session data cannot be written
-
Executes the shutdown procedure.
|