API Documentation

Session/SaveHandler/DbTable.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Session
version
$Id: DbTable.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Session_SaveHandler_DbTable

Description

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

Extends from
Zend_Db_Table_Abstract
Implements
Zend_Session_SaveHandler_Interface
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Session
subpackage
SaveHandler
Constants
PRIMARY_ASSIGNMENT
PRIMARY_ASSIGNMENT_SESSION_SAVE_PATH
PRIMARY_ASSIGNMENT_SESSION_NAME
PRIMARY_ASSIGNMENT_SESSION_ID
MODIFIED_COLUMN
LIFETIME_COLUMN
DATA_COLUMN
LIFETIME
OVERRIDE_LIFETIME
PRIMARY_TYPE_NUM
PRIMARY_TYPE_PRIMARYNUM
PRIMARY_TYPE_ASSOC
PRIMARY_TYPE_WHERECLAUSE
Properties
$_primaryAssignment
$_modifiedColumn
$_lifetimeColumn
$_dataColumn
$_lifetime
$_overrideLifetime
$_sessionSavePath
$_sessionName
Methods
__construct
__destruct
setLifetime
getLifetime
setOverrideLifetime
getOverrideLifetime
open
close
read
write
destroy
gc
_setup
_setupTableName
_setupPrimaryAssignment
_checkRequiredColumns
_getPrimary
_getLifetime
_getExpirationTime

Description

Zend_Session_SaveHandler_DbTable

Constants

PRIMARY_ASSIGNMENT

 PRIMARY_ASSIGNMENT = 'primaryAssignment'

Details

value
primaryAssignment

PRIMARY_ASSIGNMENT_SESSION_SAVE_PATH

 PRIMARY_ASSIGNMENT_SESSION_SAVE_PATH = 'sessionSavePath'

Details

value
sessionSavePath

PRIMARY_ASSIGNMENT_SESSION_NAME

 PRIMARY_ASSIGNMENT_SESSION_NAME = 'sessionName'

Details

value
sessionName

PRIMARY_ASSIGNMENT_SESSION_ID

 PRIMARY_ASSIGNMENT_SESSION_ID = 'sessionId'

Details

value
sessionId

MODIFIED_COLUMN

 MODIFIED_COLUMN = 'modifiedColumn'

Details

value
modifiedColumn

LIFETIME_COLUMN

 LIFETIME_COLUMN = 'lifetimeColumn'

Details

value
lifetimeColumn

DATA_COLUMN

 DATA_COLUMN = 'dataColumn'

Details

value
dataColumn

LIFETIME

 LIFETIME = 'lifetime'

Details

value
lifetime

OVERRIDE_LIFETIME

 OVERRIDE_LIFETIME = 'overrideLifetime'

Details

value
overrideLifetime

PRIMARY_TYPE_NUM

 PRIMARY_TYPE_NUM = 'PRIMARY_TYPE_NUM'

Details

value
PRIMARY_TYPE_NUM

PRIMARY_TYPE_PRIMARYNUM

 PRIMARY_TYPE_PRIMARYNUM = 'PRIMARY_TYPE_PRIMARYNUM'

Details

value
PRIMARY_TYPE_PRIMARYNUM

PRIMARY_TYPE_ASSOC

 PRIMARY_TYPE_ASSOC = 'PRIMARY_TYPE_ASSOC'

Details

value
PRIMARY_TYPE_ASSOC

PRIMARY_TYPE_WHERECLAUSE

 PRIMARY_TYPE_WHERECLAUSE = 'PRIMARY_TYPE_WHERECLAUSE'

Details

value
PRIMARY_TYPE_WHERECLAUSE

Properties

$_dataColumn

string $_dataColumn = 'null'

Session table data column

Details

$_dataColumn
string
visibility
protected
default
null
final
false
static
false

$_lifetime

int $_lifetime = 'false'

Session lifetime

Details

$_lifetime
int
visibility
protected
default
false
final
false
static
false

$_lifetimeColumn

string $_lifetimeColumn = 'null'

Session table lifetime column

Details

$_lifetimeColumn
string
visibility
protected
default
null
final
false
static
false

$_modifiedColumn

string $_modifiedColumn = 'null'

Session table last modification time column

Details

$_modifiedColumn
string
visibility
protected
default
null
final
false
static
false

$_overrideLifetime

boolean $_overrideLifetime = 'false'

Whether or not the lifetime of an existing session should be overridden

Details

$_overrideLifetime
boolean
visibility
protected
default
false
final
false
static
false

$_primaryAssignment

array $_primaryAssignment = 'null'

Session table primary key value assignment

Details

$_primaryAssignment
array
visibility
protected
default
null
final
false
static
false

$_sessionName

string $_sessionName = ''

Session name

Details

$_sessionName
string
visibility
protected
default
final
false
static
false

$_sessionSavePath

string $_sessionSavePath = ''

Session save path

Details

$_sessionSavePath
string
visibility
protected
default
final
false
static
false

Methods

__construct

__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)

Arguments
$config
Zend_Configarray
User-provided configuration
Details
visibility
public
final
false
static
false
throws

__destruct

__destruct( ) : void

Destructor

Details
visibility
public
final
false
static
false

_checkRequiredColumns

_checkRequiredColumns( ) : void

Check for required session table columns

Details
visibility
protected
final
false
static
false
throws

_getExpirationTime

_getExpirationTime( Zend_Db_Table_Row_Abstract $row ) : int

Retrieve session expiration time

Arguments
$row
Zend_Db_Table_Row_Abstract
Output
int
Details
visibility
protected
final
false
static
false

_getLifetime

_getLifetime( Zend_Db_Table_Row_Abstract $row ) : int

Retrieve session lifetime considering Zend_Session_SaveHandler_DbTable::OVERRIDE_LIFETIME

Arguments
$row
Zend_Db_Table_Row_Abstract
Output
int
Details
visibility
protected
final
false
static
false

_getPrimary

_getPrimary( string $id, string $type = null ) : array

Retrieve session table primary key values

Arguments
$id
string
$type
string
(optional; default: self::PRIMARY_TYPE_NUM)
Output
array
Details
visibility
protected
final
false
static
false

_setup

_setup( ) : void

Calls other protected methods for individual setup tasks and requirement checks

Details
visibility
protected
final
false
static
false

_setupPrimaryAssignment

_setupPrimaryAssignment( ) : void

Initialize session table primary key value assignment

Details
visibility
protected
final
false
static
false
throws

_setupTableName

_setupTableName( ) : void

Initialize table and schema names

Details
visibility
protected
final
false
static
false
throws

close

close( ) : boolean

Close session

Output
boolean
Details
visibility
public
final
false
static
false

destroy

destroy( string $id ) : boolean

Destroy session

Arguments
$id
string
Output
boolean
Details
visibility
public
final
false
static
false

gc

gc( int $maxlifetime ) : true

Garbage Collection

Arguments
$maxlifetime
int
Output
true
Details
visibility
public
final
false
static
false

getLifetime

getLifetime( ) : int

Retrieve session lifetime

Output
int
Details
visibility
public
final
false
static
false

getOverrideLifetime

getOverrideLifetime( ) : boolean

Retrieve whether or not the lifetime of an existing session should be overridden

Output
boolean
Details
visibility
public
final
false
static
false

open

open( string $save_path, string $name ) : boolean

Open Session

Arguments
$save_path
string
$name
string
Output
boolean
Details
visibility
public
final
false
static
false

read

read( string $id ) : string

Read session data

Arguments
$id
string
Output
string
Details
visibility
public
final
false
static
false

setLifetime

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

Arguments
$lifetime
int
$overrideLifetime
boolean
(optional)
Details
visibility
public
final
false
static
false

setOverrideLifetime

setOverrideLifetime( boolean $overrideLifetime ) : Zend_Session_SaveHandler_DbTable

Set whether or not the lifetime of an existing session should be overridden

Arguments
$overrideLifetime
boolean
Details
visibility
public
final
false
static
false

write

write( string $id, string $data ) : boolean

Write session data

Arguments
$id
string
$data
string
Output
boolean
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.