Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
core\session\memcached Class Reference

Memcached based session handler. More...

Inheritance diagram for core\session\memcached:
core\session\handler

Public Member Functions

 __construct ()
 Create new instance of handler.
 
 init ()
 Init session handler.
 
 kill_all_sessions ()
 Kill all active sessions, the core sessions table is purged afterwards.
 
 kill_session ($sid)
 Kill one session, the session record is removed afterwards. More...
 
 session_exists ($sid)
 Check the backend contains data for this session id. More...
 
 start ()
 Start the session. More...
 

Static Protected Member Functions

static connection_string_to_memcache_servers (string $str)
 Convert a connection string to an array of servers. More...
 

Protected Attributes

int $acquiretimeout = 120
 $acquiretimeout how long to wait for session lock
 
int $lockexpire = 7200
 $lockexpire how long to wait before expiring the lock so that other requests may continue execution, ignored if PECL memcached is below version 2.2.0.
 
integer $lockretrysleep = 150
 $lockretrysleep Used for memcached 3.x (PHP7), the amount of time to sleep between attempts to acquire the session lock. More...
 
string $prefix
 $prefix session key prefix

 
string $savepath
 $savepath save_path string

 
array $servers
 $servers list of servers parsed from save_path
 

Detailed Description

Memcached based session handler.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ connection_string_to_memcache_servers()

static core\session\memcached::connection_string_to_memcache_servers ( string  $str)
staticprotected

Convert a connection string to an array of servers.

"abc:123, xyz:789" to [ ['abc', '123'], ['xyz', '789'], ]

Parameters
string$strsave_path value containing memcached connection string
Return values
array[]

◆ kill_session()

core\session\memcached::kill_session (   $sid)

Kill one session, the session record is removed afterwards.

Parameters
string$sid

Reimplemented from core\session\handler.

◆ session_exists()

core\session\memcached::session_exists (   $sid)

Check the backend contains data for this session id.

Note: this is intended to be called from manager::session_exists() only.

Parameters
string$sid
Return values
booltrue if session found.

Reimplemented from core\session\handler.

◆ start()

core\session\memcached::start ( )

Start the session.

Return values
boolsuccess

Reimplemented from core\session\handler.

Member Data Documentation

◆ $lockretrysleep

integer core\session\memcached::$lockretrysleep = 150
protected

$lockretrysleep Used for memcached 3.x (PHP7), the amount of time to sleep between attempts to acquire the session lock.

Mimics the deprecated config memcached.sess_lock_wait.


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