PHP Class Mage_Core_Model_Resource_Session, Inchoo_PHP7

Author: Magento Core Team ([email protected])
Inheritance: implements Zend_Session_SaveHandler_Interface
Mostra file Open project: Inchoo/Inchoo_PHP7 Class Usage Examples

Protected Properties

Property Type Description
$_automaticCleaningFactor integer Automatic cleaning factor of expired sessions value zero means no automatic cleaning, one means automatic cleaning each time a session is closed, and x>1 means cleaning once in x calls
$_lifeTime integer Session lifetime
$_read Varien_Db_Adapter_Interface Database read connection
$_sessionTable string Session data table name
$_write Varien_Db_Adapter_Interface Database write connection

Public Methods

Method Description
__construct ( ) Constructor
__destruct ( ) Destrucor
close ( ) : boolean Close session
destroy ( string $sessId ) : boolean Destroy session
gc ( integer $sessMaxLifeTime ) : boolean Garbage collection
getLifeTime ( ) : integer Retrieve session life time
hasConnection ( ) : boolean Check DB connection
open ( string $savePath, string $sessName ) : boolean Open session
read ( string $sessId ) : string Fetch session data
setSaveHandler ( ) : Mage_Core_Model_Resource_Session Setup save handler
setStaticSaveHandler ( ) Adds session handler via static call
write ( string $sessId, string $sessData ) : boolean Update session

Method Details

__construct() public method

Constructor
public __construct ( )

__destruct() public method

Destrucor
public __destruct ( )

close() public method

Close session
public close ( ) : boolean
return boolean

destroy() public method

Destroy session
public destroy ( string $sessId ) : boolean
$sessId string
return boolean

gc() public method

Garbage collection
public gc ( integer $sessMaxLifeTime ) : boolean
$sessMaxLifeTime integer ignored
return boolean

getLifeTime() public method

Retrieve session life time
public getLifeTime ( ) : integer
return integer

hasConnection() public method

Check DB connection
public hasConnection ( ) : boolean
return boolean

open() public method

Open session
public open ( string $savePath, string $sessName ) : boolean
$savePath string ignored
$sessName string ignored
return boolean

read() public method

(Fix for PHP 7 to make sure it really returns string type as docblock promises, because otherwise session crashes.)
public read ( string $sessId ) : string
$sessId string
return string

setSaveHandler() public method

Setup save handler
public setSaveHandler ( ) : Mage_Core_Model_Resource_Session
return Mage_Core_Model_Resource_Session

setStaticSaveHandler() public static method

Adds session handler via static call
public static setStaticSaveHandler ( )

write() public method

Update session
public write ( string $sessId, string $sessData ) : boolean
$sessId string
$sessData string
return boolean

Property Details

$_automaticCleaningFactor protected_oe property

Automatic cleaning factor of expired sessions value zero means no automatic cleaning, one means automatic cleaning each time a session is closed, and x>1 means cleaning once in x calls
protected int $_automaticCleaningFactor
return integer

$_lifeTime protected_oe property

Session lifetime
protected int $_lifeTime
return integer

$_read protected_oe property

Database read connection
protected Varien_Db_Adapter_Interface $_read
return Varien_Db_Adapter_Interface

$_sessionTable protected_oe property

Session data table name
protected string $_sessionTable
return string

$_write protected_oe property

Database write connection
protected Varien_Db_Adapter_Interface $_write
return Varien_Db_Adapter_Interface