PHP Class Snc\RedisBundle\Session\Storage\Handler\RedisSessionHandler

Author: Justin Rainbow ([email protected])
Author: Jordi Boggiano ([email protected])
Author: Henrik Westphal ([email protected])
Inheritance: implements SessionHandlerInterface
Exibir arquivo Open project: snc/SncRedisBundle Class Usage Examples

Protected Properties

Property Type Description
$locked Indicates an active session lock
$locking Indicates an sessions should be locked
$prefix string
$redis Predis\Client | Redis
$ttl integer

Public Methods

Method Description
__construct ( Client | Redis $redis, array $options = [], string $prefix = 'session', $locking = true, $spinLockWait = 150000 ) Redis session storage constructor.
__destruct ( ) Destructor.
close ( )
destroy ( $sessionId )
gc ( $lifetime )
open ( $savePath, $sessionName )
read ( $sessionId )
setTtl ( integer $ttl ) Change the default TTL.
write ( $sessionId, $data )

Protected Methods

Method Description
getRedisKey ( string $key ) : string Prepends the given key with a user-defined prefix (if any).
lockSession ( $sessionId ) Lock the session data.

Private Methods

Method Description
unlockSession ( ) Unlock the session data.

Method Details

__construct() public method

Redis session storage constructor.
public __construct ( Client | Redis $redis, array $options = [], string $prefix = 'session', $locking = true, $spinLockWait = 150000 )
$redis Predis\Client | Redis Redis database connection
$options array Session options
$prefix string Prefix to use when writing session data

__destruct() public method

Destructor.
public __destruct ( )

close() public method

public close ( )

destroy() public method

public destroy ( $sessionId )

gc() public method

public gc ( $lifetime )

getRedisKey() protected method

Prepends the given key with a user-defined prefix (if any).
protected getRedisKey ( string $key ) : string
$key string key
return string prefixed key

lockSession() protected method

Lock the session data.
protected lockSession ( $sessionId )

open() public method

public open ( $savePath, $sessionName )

read() public method

public read ( $sessionId )

setTtl() public method

Change the default TTL.
public setTtl ( integer $ttl )
$ttl integer

write() public method

public write ( $sessionId, $data )

Property Details

$locked protected_oe property

Indicates an active session lock
protected $locked

$locking protected_oe property

Indicates an sessions should be locked
protected $locking

$prefix protected_oe property

protected string $prefix
return string

$redis protected_oe property

protected Client,Predis|Redis $redis
return Predis\Client | Redis

$ttl protected_oe property

protected int $ttl
return integer