Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-webat this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Zend_Session_SaveHandler_DbTable
PRIMARY_ASSIGNMENT = 'primaryAssignment'
PRIMARY_ASSIGNMENT_SESSION_SAVE_PATH = 'sessionSavePath'
PRIMARY_ASSIGNMENT_SESSION_NAME = 'sessionName'
PRIMARY_ASSIGNMENT_SESSION_ID = 'sessionId'
MODIFIED_COLUMN = 'modifiedColumn'
LIFETIME_COLUMN = 'lifetimeColumn'
DATA_COLUMN = 'dataColumn'
LIFETIME = 'lifetime'
OVERRIDE_LIFETIME = 'overrideLifetime'
PRIMARY_TYPE_NUM = 'PRIMARY_TYPE_NUM'
PRIMARY_TYPE_PRIMARYNUM = 'PRIMARY_TYPE_PRIMARYNUM'
PRIMARY_TYPE_ASSOC = 'PRIMARY_TYPE_ASSOC'
PRIMARY_TYPE_WHERECLAUSE = 'PRIMARY_TYPE_WHERECLAUSE'
string $_dataColumn = 'null'
Session table data column
int $_lifetime = 'false'
Session lifetime
string $_lifetimeColumn = 'null'
Session table lifetime column
string $_modifiedColumn = 'null'
Session table last modification time column
boolean $_overrideLifetime = 'false'
Whether or not the lifetime of an existing session should be overridden
array $_primaryAssignment = 'null'
Session table primary key value assignment
string $_sessionName = ''
Session name
string $_sessionSavePath = ''
Session save path
__construct(
Zend_Config|array $config
)
:
void
Constructor
$config is an instance of Zend_Config or an array of key/value pairs containing configuration options for Zend_Session_SaveHandler_DbTable and Zend_Db_Table_Abstract. These are the configuration options for Zend_Session_SaveHandler_DbTable:
primaryAssignment => (string|array) Session table primary key value assignment (optional; default: 1 => sessionId) You have to assign a value to each primary key of your session table. The value of this configuration option is either a string if you have only one primary key or an array if you have multiple primary keys. The array consists of numeric keys starting at 1 and string values. There are some values which will be replaced by session information:
sessionId => The id of the current session
sessionName => The name of the current session
sessionSavePath => The save path of the current session
NOTE: One of your assignments MUST contain 'sessionId' as value!
modifiedColumn => (string) Session table last modification time column
lifetimeColumn => (string) Session table lifetime column
dataColumn => (string) Session table data column
lifetime => (integer) Session lifetime (optional; default: ini_get('session.gc_maxlifetime'))
overrideLifetime => (boolean) Whether or not the lifetime of an existing session should be overridden (optional; default: false)
__destruct(
)
:
void
Destructor
_checkRequiredColumns(
)
:
void
Check for required session table columns
_getExpirationTime(
Zend_Db_Table_Row_Abstract $row
)
:
int
Retrieve session expiration time
_getLifetime(
Zend_Db_Table_Row_Abstract $row
)
:
int
Retrieve session lifetime considering Zend_Session_SaveHandler_DbTable::OVERRIDE_LIFETIME
_getPrimary(
string $id, string $type
=
null
)
:
array
Retrieve session table primary key values
_setup(
)
:
void
Calls other protected methods for individual setup tasks and requirement checks
_setupPrimaryAssignment(
)
:
void
Initialize session table primary key value assignment
_setupTableName(
)
:
void
Initialize table and schema names
close(
)
:
boolean
Close session
destroy(
string $id
)
:
boolean
Destroy session
gc(
int $maxlifetime
)
:
true
Garbage Collection
getLifetime(
)
:
int
Retrieve session lifetime
getOverrideLifetime(
)
:
boolean
Retrieve whether or not the lifetime of an existing session should be overridden
open(
string $save_path, string $name
)
:
boolean
Open Session
read(
string $id
)
:
string
Read session data
setLifetime(
int $lifetime, boolean $overrideLifetime
=
null
)
:
Zend_Session_SaveHandler_DbTable
Set session lifetime and optional whether or not the lifetime of an existing session should be overridden
$lifetime === false resets lifetime to session.gc_maxlifetime
setOverrideLifetime(
boolean $overrideLifetime
)
:
Zend_Session_SaveHandler_DbTable
Set whether or not the lifetime of an existing session should be overridden
write(
string $id, string $data
)
:
boolean
Write session data