MediaWiki  REL1_19
MemcachedSessions.php File Reference

This file gets included if $wgSessionsInMemcache is set in the config. More...

Go to the source code of this file.

Functions

 memsess_close ()
 Callback when closing a session.
 memsess_destroy ($id)
 Callback to destroy a session when calling session_destroy().
 memsess_gc ($maxlifetime)
 Callback to execute garbage collection.
 memsess_key ($id)
 Get a cache key for the given session id.
 memsess_open ($save_path, $session_name)
 Callback when opening a session.
 memsess_read ($id)
 Callback when reading session data.
 memsess_write ($id, $data)
 Callback when writing session data.
 memsess_write_close ()

Detailed Description

This file gets included if $wgSessionsInMemcache is set in the config.

It redirects session handling functions to store their data in memcached instead of the local filesystem. Depending on circumstances, it may also be necessary to change the cookie settings to work across hostnames. See: http://www.php.net/manual/en/function.session-set-save-handler.php

Definition in file MemcachedSessions.php.


Function Documentation

Callback when closing a session.

NOP.

Returns:
Boolean: success

Definition at line 41 of file MemcachedSessions.php.

memsess_destroy ( id)

Callback to destroy a session when calling session_destroy().

Parameters:
$idString: session id
Returns:
Boolean: success

Definition at line 77 of file MemcachedSessions.php.

References $wgMemc, and memsess_key().

Here is the call graph for this function:

memsess_gc ( maxlifetime)

Callback to execute garbage collection.

NOP: Memcached performs garbage collection.

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

Definition at line 91 of file MemcachedSessions.php.

memsess_key ( id)

Get a cache key for the given session id.

Parameters:
$idString: session id
Returns:
String: cache key

Definition at line 19 of file MemcachedSessions.php.

References wfMemcKey().

Referenced by memsess_destroy(), memsess_read(), and memsess_write().

Here is the call graph for this function:

Here is the caller graph for this function:

memsess_open ( save_path,
session_name 
)

Callback when opening a session.

NOP: $wgMemc should be set up already.

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

Definition at line 31 of file MemcachedSessions.php.

memsess_read ( id)

Callback when reading session data.

Parameters:
$idString: session id
Returns:
Mixed: session data

Definition at line 51 of file MemcachedSessions.php.

References $wgMemc, and memsess_key().

Here is the call graph for this function:

memsess_write ( id,
data 
)

Callback when writing session data.

Parameters:
$idString: session id
$dataMixed: session data
Returns:
Boolean: success

Definition at line 65 of file MemcachedSessions.php.

References $wgMemc, and memsess_key().

Here is the call graph for this function:

Definition at line 95 of file MemcachedSessions.php.