34 $session = MediaWiki\Session\SessionManager::getGlobalSession();
38 $session->unpersist();
43 if ( !$session->canSetUser() ) {
46 'cannotlogoutnow-text',
47 $session->getProvider()->describe( $this->getErrorFormatter()->getLanguage() )
54 $oldName = $user->getName();
59 Hooks::run(
'UserLogoutComplete', [ &$user, &$injected_html, $oldName ] );
80 'action=logout&token=123ABC'
81 =>
'apihelp-logout-example-logout',
86 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Logout';
This abstract class implements many basic API functions, and is the base of all API classes.
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
API module to allow users to log out of the wiki.
getWebUITokenSalt(array $params)
Fetch the salt used in the Web UI corresponding to this module.
needsToken()
Returns the token type this module requires in order to execute.
getHelpUrls()
Return links to more detailed help pages about the module.
mustBePosted()
Indicates whether this module must be called with a POST request.
isReadMode()
Indicates whether this module requires read rights.
getExamplesMessages()
Returns usage examples for this module.
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))