Session/SaveHandler/DbTable.php
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.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Session
- Version
- $Id$
\Zend_Session_SaveHandler_DbTable
Package: Zend_Session\SaveHandler



Throws












Returns

Zend_Session_SaveHandler_DbTable
- Implements
- Parent(s)
- \Zend_Db_Table_Abstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
Properties

string $_modifiedColumn = nullSession table last modification time column
Default value
nullDetails- Type
- string

boolean $_overrideLifetime = falseWhether or not the lifetime of an existing session should be overridden
Default value
falseDetails- Type
- boolean

array $_primaryAssignment = nullSession table primary key value assignment
Default value
nullDetails- Type
- array
Methods

__construct(\Zend_Config | array $config) : voidConstructor
$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)
Parameters| Name | Type | Description |
|---|---|---|
| $config | \Zend_Config | array | User-provided configuration |
| Exception | Description |
|---|---|
| \Zend_Session_SaveHandler_Exception |

_checkRequiredColumns() : voidCheck for required session table columns
Throws
| Exception | Description |
|---|---|
| \Zend_Session_SaveHandler_Exception |

_getExpirationTime(\Zend_Db_Table_Row_Abstract $row) : intRetrieve session expiration time
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $row | \Zend_Db_Table_Row_Abstract |
| Type | Description |
|---|---|
| int |

_getLifetime(\Zend_Db_Table_Row_Abstract $row) : intRetrieve session lifetime considering Zend_Session_SaveHandler_DbTable::OVERRIDE_LIFETIME
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $row | \Zend_Db_Table_Row_Abstract |
| Type | Description |
|---|---|
| int |

_getPrimary(string $id, string $type = null) : arrayRetrieve session table primary key values
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $id | string | |
| $type | string | (optional; default: self::PRIMARY_TYPE_NUM) |
| Type | Description |
|---|---|
| array |

_setupPrimaryAssignment() : voidInitialize session table primary key value assignment
Throws
| Exception | Description |
|---|---|
| \Zend_Session_SaveHandler_Exception |

_setupTableName() : voidInitialize table and schema names
Throws
| Exception | Description |
|---|---|
| \Zend_Session_SaveHandler_Exception |

destroy(string $id) : booleanDestroy session
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $id | string |
| Type | Description |
|---|---|
| boolean |

gc(int $maxlifetime) : trueGarbage Collection
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $maxlifetime | int |
| Type | Description |
|---|---|
| true |

getOverrideLifetime() : booleanRetrieve whether or not the lifetime of an existing session should be overridden
Returns
| Type | Description |
|---|---|
| boolean |

open(string $save_path, string $name) : booleanOpen Session
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $save_path | string | |
| $name | string |
| Type | Description |
|---|---|
| boolean |

read(string $id) : stringRead session data
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $id | string |
| Type | Description |
|---|---|
| string |

setLifetime(int $lifetime, boolean $overrideLifetime = null) : \Zend_Session_SaveHandler_DbTableSet session lifetime and optional whether or not the lifetime of an existing session should be overridden
$lifetime === false resets lifetime to session.gc_maxlifetime
Parameters| Name | Type | Description |
|---|---|---|
| $lifetime | int | |
| $overrideLifetime | boolean | (optional) |
| Type | Description |
|---|---|
| \Zend_Session_SaveHandler_DbTable |

setOverrideLifetime(boolean $overrideLifetime) : \Zend_Session_SaveHandler_DbTableSet whether or not the lifetime of an existing session should be overridden
Parameters
Returns
| Name | Type | Description |
|---|---|---|
| $overrideLifetime | boolean |
| Type | Description |
|---|---|
| \Zend_Session_SaveHandler_DbTable |