Go to the documentation of this file.
46 $sourceUrl = $this->file->getArchiveVirtualUrl( $this->archiveName );
49 $this->params[
'comment'],
50 $this->params[
'comment'],
58 $result = [
'result' =>
'Success' ];
61 'result' =>
'Failure',
84 $this->file = $localRepo->newFile(
$title );
85 if ( !$this->file->exists() ) {
90 $this->archiveName = $this->params[
'archivename'];
91 $oldFile = $localRepo->newFromArchiveName(
$title, $this->archiveName );
92 if ( !$oldFile->exists() ) {
127 'action=filerevert&filename=Wiki.png&comment=Revert&' .
128 'archivename=20110305152740!Wiki.png&token=123ABC'
129 =>
'apihelp-filerevert-example-revert',
isWriteMode()
Indicates whether this module requires write mode.
const PARAM_REQUIRED
(boolean) Is the parameter required?
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
needsToken()
Returns the token type this module requires in order to execute.
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
getResult()
Get the result object.
checkTitleUserPermissions(LinkTarget $linkTarget, $actions, $options=[])
Helper function for permission-denied errors.
This abstract class implements many basic API functions, and is the base of all API classes.
mustBePosted()
Indicates whether this module must be called with a POST request.
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
Class to represent a local file in the wiki's own database.
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
getModuleName()
Get the name of the module being executed by this instance.
getExamplesMessages()
Returns usage examples for this module.
validateParameters()
Validate the user parameters and set $this->archiveName and $this->file.
getErrorFormatter()
Get the error formatter.