MediaWiki  master
MediaWiki\Session\PHPSessionHandler Class Reference

Adapter for PHP's session handling. More...

Inheritance diagram for MediaWiki\Session\PHPSessionHandler:
Collaboration diagram for MediaWiki\Session\PHPSessionHandler:

Public Member Functions

 close ()
 Close the session (handler) More...
 destroy ( $id)
 Destroy a session. More...
 gc ( $maxlifetime)
 Execute garbage collection. More...
 open ( $save_path, $session_name)
 Initialize the session (handler) More...
 read ( $id)
 Read session data. More...
 setManager (SessionManagerInterface $manager, BagOStuff $store, LoggerInterface $logger)
 Set the manager, store, and logger. More...
 write ( $id, $dataStr)
 Write session data. More...

Static Public Member Functions

static install (SessionManager $manager)
 Install a session handler for the current web request. More...
static isEnabled ()
 Test whether the handler is installed and enabled. More...
static isInstalled ()
 Test whether the handler is installed. More...

Protected Member Functions

 __construct (SessionManager $manager)

Protected Attributes

bool $enable = false
 Whether PHP session handling is enabled. More...
LoggerInterface $logger
SessionManagerInterface null $manager
array $sessionFieldCache = []
 Track original session fields for later modification check. More...
BagOStuff null $store
bool $warn = true

Static Protected Attributes

static PHPSessionHandler $instance = null

Private Member Functions

 setEnableFlags ( $PHPSessionHandling)
 Set $this->enable and $this->warn. More...

Detailed Description

Adapter for PHP's session handling.


Definition at line 35 of file PHPSessionHandler.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Session\PHPSessionHandler::__construct ( SessionManager  $manager)

Member Function Documentation

◆ close()

MediaWiki\Session\PHPSessionHandler::close ( )

Close the session (handler)

Definition at line 196 of file PHPSessionHandler.php.

◆ destroy()

MediaWiki\Session\PHPSessionHandler::destroy (   $id)

Destroy a session.

Definition at line 344 of file PHPSessionHandler.php.

◆ gc()

MediaWiki\Session\PHPSessionHandler::gc (   $maxlifetime)

Execute garbage collection.

Definition at line 365 of file PHPSessionHandler.php.

◆ install()

static MediaWiki\Session\PHPSessionHandler::install ( SessionManager  $manager)

Install a session handler for the current web request.


Definition at line 111 of file PHPSessionHandler.php.

References MediaWiki\Session\PHPSessionHandler\$manager.

◆ isEnabled()

static MediaWiki\Session\PHPSessionHandler::isEnabled ( )

◆ isInstalled()

static MediaWiki\Session\PHPSessionHandler::isInstalled ( )

Test whether the handler is installed.


Definition at line 95 of file PHPSessionHandler.php.

References MediaWiki\Session\PHPSessionHandler\$instance.

◆ open()

MediaWiki\Session\PHPSessionHandler::open (   $save_path,

Initialize the session (handler)

Definition at line 181 of file PHPSessionHandler.php.

◆ read()

MediaWiki\Session\PHPSessionHandler::read (   $id)

Read session data.

Definition at line 210 of file PHPSessionHandler.php.

◆ setEnableFlags()

MediaWiki\Session\PHPSessionHandler::setEnableFlags (   $PHPSessionHandling)

Set $this->enable and $this->warn.

Separate just because there doesn't seem to be a good way to test it otherwise.

string$PHPSessionHandlingSee $wgPHPSessionHandling

Definition at line 72 of file PHPSessionHandler.php.

Referenced by MediaWiki\Session\PHPSessionHandler\__construct().

◆ setManager()

MediaWiki\Session\PHPSessionHandler::setManager ( SessionManagerInterface  $manager,
BagOStuff  $store,
LoggerInterface  $logger 

◆ write()

MediaWiki\Session\PHPSessionHandler::write (   $id,

Write session data.

Definition at line 238 of file PHPSessionHandler.php.

References $cache, and wfDeprecated().

Member Data Documentation

◆ $enable

bool MediaWiki\Session\PHPSessionHandler::$enable = false

Whether PHP session handling is enabled.

Definition at line 40 of file PHPSessionHandler.php.

◆ $instance

PHPSessionHandler MediaWiki\Session\PHPSessionHandler::$instance = null

◆ $logger

LoggerInterface MediaWiki\Session\PHPSessionHandler::$logger

◆ $manager

◆ $sessionFieldCache

array MediaWiki\Session\PHPSessionHandler::$sessionFieldCache = []

Track original session fields for later modification check.

Definition at line 55 of file PHPSessionHandler.php.

◆ $store

BagOStuff null MediaWiki\Session\PHPSessionHandler::$store

◆ $warn

bool MediaWiki\Session\PHPSessionHandler::$warn = true

Definition at line 43 of file PHPSessionHandler.php.

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