Go to the documentation of this file.
33 if ( !$this->
getConfig()->
get(
'PageLanguageUseDB' ) ) {
34 return 'apihelp-setpagelanguage-extended-description-disabled';
36 return parent::getExtendedDescription();
48 if ( !$this->
getConfig()->
get(
'PageLanguageUseDB' ) ) {
60 if ( !$pageObj->exists() ) {
64 $titleObj = $pageObj->getTitle();
72 if ( $params[
'tags'] ) {
74 if ( !$tagStatus->isOK() ) {
83 $params[
'reason'] ??
'',
92 'title' => $titleObj->getPrefixedText(),
93 'oldlanguage' =>
$status->value->oldLanguage,
94 'newlanguage' =>
$status->value->newLanguage,
95 'logid' =>
$status->value->logId
135 'action=setpagelanguage&title=Main%20Page&lang=eu&token=123ABC'
136 =>
'apihelp-setpagelanguage-example-language',
137 'action=setpagelanguage&pageid=123&lang=default&token=123ABC'
138 =>
'apihelp-setpagelanguage-example-default',
143 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:SetPageLanguage';
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.
mustBePosted()
Indicates whether this module must be called with a POST request.
checkUserRightsAny( $rights, $user=null)
Helper function for permission-denied errors.
checkTitleUserPermissions(LinkTarget $linkTarget, $actions, $options=[])
Helper function for permission-denied errors.
getExtendedDescription()
Return the extended help text message.
This abstract class implements many basic API functions, and is the base of all API classes.
isWriteMode()
Indicates whether this module requires write mode.
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
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...
execute()
Extracts the title and language from the request parameters and invokes the static SpecialPageLanguag...
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.
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.
static fetchLanguageNames( $inLanguage=self::AS_AUTONYMS, $include='mw')
Get an array of language names, indexed by code.
getHelpUrls()
Return links to more detailed help pages about the module.