Go to the documentation of this file.
37 if ( !$this->
getConfig()->
get(
'PageLanguageUseDB' ) ) {
38 return 'apihelp-setpagelanguage-description-disabled';
40 return parent::getDescriptionMessage();
52 if ( !$this->
getConfig()->
get(
'PageLanguageUseDB' ) ) {
64 if ( !$pageObj->exists() ) {
68 $titleObj = $pageObj->getTitle();
78 if ( !$tagStatus->isOK() ) {
96 'title' => $titleObj->getPrefixedText(),
97 'oldlanguage' =>
$status->value->oldLanguage,
98 'newlanguage' =>
$status->value->newLanguage,
99 'logid' =>
$status->value->logId
139 'action=setpagelanguage&title=Main%20Page&lang=eu&token=123ABC'
140 =>
'apihelp-setpagelanguage-example-language',
141 'action=setpagelanguage&pageid=123&lang=default&token=123ABC'
142 =>
'apihelp-setpagelanguage-example-default',
147 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:SetPageLanguage';
getConfig()
Get the Config object.
const PARAM_REQUIRED
(boolean) Is the parameter required?
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
getTitleOrPageId( $params, $load=false)
Get a WikiPage object from a title or pageid param, if possible.
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
getResult()
Get the result object.
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 $status
mustBePosted()
Indicates whether this module must be called with a POST request.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
checkUserRightsAny( $rights, $user=null)
Helper function for permission-denied errors.
getUser()
Get the User object.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
This abstract class implements many basic API functions, and is the base of all API classes.
static fetchLanguageNames( $inLanguage=null, $include='mw')
Get an array of language names, indexed by code.
isWriteMode()
Indicates whether this module requires write mode.
API module that facilitates changing the language of a page.
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
extractRequestParams( $parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user,...
execute()
Extracts the title and language from the request parameters and invokes the static SpecialPageLanguag...
checkTitleUserPermissions(Title $title, $actions, $user=null)
Helper function for permission-denied errors.
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
getExamplesMessages()
Returns usage examples for this module.
needsToken()
Returns the token type this module requires in order to execute.
getDescriptionMessage()
Return the description message.
static changePageLanguage(IContextSource $context, Title $title, $newLanguage, $reason, array $tags=[])
dieStatus(StatusValue $status)
Throw an ApiUsageException based on the Status object.
getModuleName()
Get the name of the module being executed by this instance.
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
getHelpUrls()
Return links to more detailed help pages about the module.