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'] ??
'',
87 if ( !$status->isOK() ) {
92 'title' => $titleObj->getPrefixedText(),
93 'oldlanguage' => $status->value->oldLanguage,
94 'newlanguage' => $status->value->newLanguage,
95 'logid' => $status->value->logId
117 array_keys( Language::fetchLanguageNames(
null,
'mwfile' ) )
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';
This abstract class implements many basic API functions, and is the base of all API classes.
const PARAM_REQUIRED
(boolean) Is the parameter required?
checkUserRightsAny( $rights, $user=null)
Helper function for permission-denied errors.
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
checkTitleUserPermissions(LinkTarget $linkTarget, $actions, $options=[])
Helper function for permission-denied errors.
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
getResult()
Get the result object.
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
getModuleName()
Get the name of the module being executed by this instance.
getTitleOrPageId( $params, $load=false)
Get a WikiPage object from a title or pageid param, if possible.
dieStatus(StatusValue $status)
Throw an ApiUsageException based on the Status object.
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
API module that facilitates changing the language of a page.
needsToken()
Returns the token type this module requires in order to execute.
getExtendedDescription()
Return the extended help text message.
isWriteMode()
Indicates whether this module requires write mode.
getHelpUrls()
Return links to more detailed help pages about the module.
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...
getExamplesMessages()
Returns usage examples for this module.
mustBePosted()
Indicates whether this module must be called with a POST request.
static changePageLanguage(IContextSource $context, Title $title, $newLanguage, $reason, array $tags=[])