MediaWiki
1.34.0
|
Adapter for PHP's session handling. More...
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... | |
|
protected |
Definition at line 57 of file PHPSessionHandler.php.
References MediaWiki\Session\PHPSessionHandler\$manager, RequestContext\getMain(), and MediaWiki\Session\PHPSessionHandler\setEnableFlags().
MediaWiki\Session\PHPSessionHandler::close | ( | ) |
Close the session (handler)
Definition at line 196 of file PHPSessionHandler.php.
MediaWiki\Session\PHPSessionHandler::destroy | ( | $id | ) |
Destroy a session.
string | $id | Session id |
Definition at line 344 of file PHPSessionHandler.php.
MediaWiki\Session\PHPSessionHandler::gc | ( | $maxlifetime | ) |
Execute garbage collection.
int | $maxlifetime | Maximum session life time (ignored) |
Definition at line 365 of file PHPSessionHandler.php.
|
static |
Install a session handler for the current web request.
SessionManager | $manager |
Definition at line 111 of file PHPSessionHandler.php.
References MediaWiki\Session\PHPSessionHandler\$manager.
|
static |
Test whether the handler is installed and enabled.
Definition at line 103 of file PHPSessionHandler.php.
Referenced by MediaWiki\Session\SessionBackend\checkPHPSession(), MediaWiki\Session\SessionManager\getGlobalSession(), MediaWiki\Session\SessionBackend\resetId(), and MediaWiki\Session\SessionBackend\unpersist().
|
static |
Test whether the handler is installed.
Definition at line 95 of file PHPSessionHandler.php.
References MediaWiki\Session\PHPSessionHandler\$instance.
MediaWiki\Session\PHPSessionHandler::open | ( | $save_path, | |
$session_name | |||
) |
Initialize the session (handler)
string | $save_path | Path used to store session files (ignored) |
string | $session_name | Session name (ignored) |
Definition at line 181 of file PHPSessionHandler.php.
MediaWiki\Session\PHPSessionHandler::read | ( | $id | ) |
Read session data.
string | $id | Session id |
Definition at line 210 of file PHPSessionHandler.php.
|
private |
Set $this->enable and $this->warn.
Separate just because there doesn't seem to be a good way to test it otherwise.
string | $PHPSessionHandling | See $wgPHPSessionHandling |
Definition at line 72 of file PHPSessionHandler.php.
Referenced by MediaWiki\Session\PHPSessionHandler\__construct().
MediaWiki\Session\PHPSessionHandler::setManager | ( | SessionManagerInterface | $manager, |
BagOStuff | $store, | ||
LoggerInterface | $logger | ||
) |
Set the manager, store, and logger.
SessionManagerInterface | $manager | |
BagOStuff | $store | |
LoggerInterface | $logger |
Definition at line 159 of file PHPSessionHandler.php.
References MediaWiki\Session\PHPSessionHandler\$logger, MediaWiki\Session\PHPSessionHandler\$manager, and MediaWiki\Session\PHPSessionHandler\$store.
Referenced by MediaWiki\Session\SessionManager\setupPHPSessionHandler().
MediaWiki\Session\PHPSessionHandler::write | ( | $id, | |
$dataStr | |||
) |
Write session data.
string | $id | Session id |
string | $dataStr | Session data. Not that you should ever call this directly, but note that this has the same issues with code injection via user-controlled data as does PHP's unserialize function. |
Definition at line 238 of file PHPSessionHandler.php.
References $cache, and wfDeprecated().
|
protected |
Whether PHP session handling is enabled.
Definition at line 40 of file PHPSessionHandler.php.
|
staticprotected |
Definition at line 37 of file PHPSessionHandler.php.
Referenced by MediaWiki\Session\PHPSessionHandler\isInstalled().
|
protected |
Definition at line 52 of file PHPSessionHandler.php.
Referenced by MediaWiki\Session\PHPSessionHandler\setManager().
|
protected |
Definition at line 46 of file PHPSessionHandler.php.
Referenced by MediaWiki\Session\PHPSessionHandler\__construct(), MediaWiki\Session\PHPSessionHandler\install(), and MediaWiki\Session\PHPSessionHandler\setManager().
|
protected |
Track original session fields for later modification check.
Definition at line 55 of file PHPSessionHandler.php.
|
protected |
Definition at line 49 of file PHPSessionHandler.php.
Referenced by MediaWiki\Session\PHPSessionHandler\setManager().
|
protected |
Definition at line 43 of file PHPSessionHandler.php.