MediaWiki  1.29.2
MediaWiki\Session\SessionManagerInterface Interface Reference

This exists to make IDEs happy, so they don't see the internal-but-required-to-be-public methods on SessionManager. More...

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

Public Member Functions

 getEmptySession (WebRequest $request=null)
 Create a new, empty session. More...
 
 getSessionById ( $id, $create=false, WebRequest $request=null)
 Fetch a session by ID. More...
 
 getSessionForRequest (WebRequest $request)
 Fetch the session for a request (or a new empty session if none is attached to it) More...
 
 getVaryCookies ()
 Return the list of cookies that need varying on. More...
 
 getVaryHeaders ()
 Return the HTTP headers that need varying on. More...
 
 invalidateSessionsForUser (User $user)
 Invalidate sessions for a user. More...
 

Detailed Description

This exists to make IDEs happy, so they don't see the internal-but-required-to-be-public methods on SessionManager.

Since
1.27

Definition at line 37 of file SessionManagerInterface.php.

Member Function Documentation

◆ getEmptySession()

MediaWiki\Session\SessionManagerInterface::getEmptySession ( WebRequest  $request = null)

Create a new, empty session.

The first provider configured that is able to provide an empty session will be used.

Parameters
WebRequest | null$requestCorresponding request. Any existing session associated with this WebRequest object will be overwritten.
Returns
Session

Implemented in MediaWiki\Session\SessionManager.

◆ getSessionById()

MediaWiki\Session\SessionManagerInterface::getSessionById (   $id,
  $create = false,
WebRequest  $request = null 
)

Fetch a session by ID.

Parameters
string$id
bool$createIf no session exists for $id, try to create a new one. May still return null if a session for $id exists but cannot be loaded.
WebRequest | null$requestCorresponding request. Any existing session associated with this WebRequest object will be overwritten.
Returns
Session|null

Implemented in MediaWiki\Session\SessionManager.

◆ getSessionForRequest()

MediaWiki\Session\SessionManagerInterface::getSessionForRequest ( WebRequest  $request)

Fetch the session for a request (or a new empty session if none is attached to it)

Note
You probably want to use $request->getSession() instead. It's more efficient and doesn't break FauxRequests or sessions that were changed by $this->getSessionById() or $this->getEmptySession().
Parameters
WebRequest$requestAny existing associated session will be reset to the session corresponding to the data in the request itself.
Returns
Session
Exceptions

Implemented in MediaWiki\Session\SessionManager.

◆ getVaryCookies()

MediaWiki\Session\SessionManagerInterface::getVaryCookies ( )

Return the list of cookies that need varying on.

Returns
string[]

Implemented in MediaWiki\Session\SessionManager.

◆ getVaryHeaders()

MediaWiki\Session\SessionManagerInterface::getVaryHeaders ( )

Return the HTTP headers that need varying on.

The return value is such that someone could theoretically do this:

foreach ( $provider->getVaryHeaders() as $header => $options ) {
$outputPage->addVaryHeader( $header, $options );
}
Returns
array

Implemented in MediaWiki\Session\SessionManager.

◆ invalidateSessionsForUser()

MediaWiki\Session\SessionManagerInterface::invalidateSessionsForUser ( User  $user)

Invalidate sessions for a user.

After calling this, existing sessions should be invalid. For mutable session providers, this generally means the user has to log in again; for immutable providers, it generally means the loss of session data.

Parameters
User$user

Implemented in MediaWiki\Session\SessionManager.


The documentation for this interface was generated from the following file:
$header
$header
Definition: updateCredits.php:35
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
$options
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content as context as context $options
Definition: hooks.txt:1049