MediaWiki  1.23.13
ObjectCacheSessionHandler Class Reference

Session storage in object cache. More...

Static Public Member Functions

static close ()
 Callback when closing a session. More...
 
static destroy ( $id)
 Callback to destroy a session when calling session_destroy(). More...
 
static gc ( $maxlifetime)
 Callback to execute garbage collection. More...
 
static getCache ()
 Get the cache storage object to use for session storage. More...
 
static getKey ( $id)
 Get a cache key for the given session id. More...
 
static handleShutdown ()
 Shutdown function. More...
 
static install ()
 Install a session handler for the current web request. More...
 
static open ( $save_path, $session_name)
 Callback when opening a session. More...
 
static read ( $id)
 Callback when reading session data. More...
 
static write ( $id, $data)
 Callback when writing session data. More...
 

Detailed Description

Session storage in object cache.

Used if $wgSessionsInObjectCache is true.

Definition at line 30 of file ObjectCacheSessionHandler.php.

Member Function Documentation

◆ close()

static ObjectCacheSessionHandler::close ( )
static

Callback when closing a session.

NOP.

Returns
Boolean: success

Definition at line 85 of file ObjectCacheSessionHandler.php.

◆ destroy()

static ObjectCacheSessionHandler::destroy (   $id)
static

Callback to destroy a session when calling session_destroy().

Parameters
string$idsession id
Returns
Boolean: success

Definition at line 122 of file ObjectCacheSessionHandler.php.

References getCache().

◆ gc()

static ObjectCacheSessionHandler::gc (   $maxlifetime)
static

Callback to execute garbage collection.

NOP: Object caches perform garbage collection implicitly

Parameters
$maxlifetimeInteger: maximum session life time
Returns
Boolean: success

Definition at line 134 of file ObjectCacheSessionHandler.php.

◆ getCache()

static ObjectCacheSessionHandler::getCache ( )
static

Get the cache storage object to use for session storage.

Definition at line 53 of file ObjectCacheSessionHandler.php.

References ObjectCache\getInstance(), and global.

Referenced by destroy(), read(), and write().

◆ getKey()

static ObjectCacheSessionHandler::getKey (   $id)
static

Get a cache key for the given session id.

Parameters
string$idsession id
Returns
String: cache key

Definition at line 64 of file ObjectCacheSessionHandler.php.

References wfMemcKey().

◆ handleShutdown()

static ObjectCacheSessionHandler::handleShutdown ( )
static

Shutdown function.

See the comment inside ObjectCacheSessionHandler::install for rationale.

Definition at line 142 of file ObjectCacheSessionHandler.php.

◆ install()

static ObjectCacheSessionHandler::install ( )
static

Install a session handler for the current web request.

Definition at line 34 of file ObjectCacheSessionHandler.php.

References array().

◆ open()

static ObjectCacheSessionHandler::open (   $save_path,
  $session_name 
)
static

Callback when opening a session.

Parameters
$save_pathString: path used to store session files, unused
$session_nameString: session name
Returns
Boolean: success

Definition at line 75 of file ObjectCacheSessionHandler.php.

◆ read()

static ObjectCacheSessionHandler::read (   $id)
static

Callback when reading session data.

Parameters
string$idsession id
Returns
Mixed: session data

Definition at line 95 of file ObjectCacheSessionHandler.php.

References getCache().

◆ write()

static ObjectCacheSessionHandler::write (   $id,
  $data 
)
static

Callback when writing session data.

Parameters
string$idsession id
$dataMixed: session data
Returns
Boolean: success

Definition at line 110 of file ObjectCacheSessionHandler.php.

References getCache(), and global.


The documentation for this class was generated from the following file: