PHP Class CI_Session_redis_driver, TastyIgniter

Inheritance: extends CI_Session_driver, implements SessionHandlerInterface
显示文件 Open project: tastyigniter/tastyigniter

Protected Properties

Property Type Description
$_key_exists boolean Key exists flag
$_key_prefix string Key prefix
$_lock_key string Lock key
$_redis resource phpRedis instance

Public Methods

Method Description
__construct ( array &$params ) : void Class constructor
close ( ) : boolean Close
destroy ( string $session_id ) : boolean Destroy
gc ( integer $maxlifetime ) : boolean Garbage Collector
open ( string $save_path, string $name ) : boolean Open
read ( string $session_id ) : string Read
write ( string $session_id, string $session_data ) : boolean Write

Protected Methods

Method Description
_get_lock ( string $session_id ) : boolean Get lock
_release_lock ( ) : boolean Release lock

Method Details

__construct() public method

Class constructor
public __construct ( array &$params ) : void
$params array Configuration parameters
return void

_get_lock() protected method

Acquires an (emulated) lock.
protected _get_lock ( string $session_id ) : boolean
$session_id string Session ID
return boolean

_release_lock() protected method

Releases a previously acquired lock
protected _release_lock ( ) : boolean
return boolean

close() public method

Releases locks and closes connection.
public close ( ) : boolean
return boolean

destroy() public method

Destroys the current session.
public destroy ( string $session_id ) : boolean
$session_id string Session ID
return boolean

gc() public method

Deletes expired sessions
public gc ( integer $maxlifetime ) : boolean
$maxlifetime integer Maximum lifetime of sessions
return boolean

open() public method

Sanitizes save_path and initializes connection.
public open ( string $save_path, string $name ) : boolean
$save_path string Server path
$name string Session cookie name, unused
return boolean

read() public method

Reads session data and acquires a lock
public read ( string $session_id ) : string
$session_id string Session ID
return string Serialized session data

write() public method

Writes (create / update) session data
public write ( string $session_id, string $session_data ) : boolean
$session_id string Session ID
$session_data string Serialized session data
return boolean

Property Details

$_key_exists protected_oe property

Key exists flag
protected bool $_key_exists
return boolean

$_key_prefix protected_oe property

Key prefix
protected string $_key_prefix
return string

$_lock_key protected_oe property

Lock key
protected string $_lock_key
return string

$_redis protected_oe property

phpRedis instance
protected resource $_redis
return resource