40 if ( isset(
$params[
'rcid'] ) ) {
50 $rc =
$rev->getRecentChange();
60 if ( !is_null( $tags ) ) {
62 if ( !$ableToTag->isOK() ) {
67 $retval = $rc->doMarkPatrolled( $user,
false, $tags );
73 $result = [
'rcid' => intval( $rc->getAttribute(
'rc_id' ) ) ];
107 'action=patrol&token=123ABC&rcid=230672766'
108 =>
'apihelp-patrol-example-rcid',
109 'action=patrol&token=123ABC&revid=230672766'
110 =>
'apihelp-patrol-example-revid',
115 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Patrol';
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.
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
errorArrayToStatus(array $errors, User $user=null)
Turn an array of message keys or key+param arrays into a Status.
extractRequestParams( $parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user,...
getResult()
Get the result object.
getModuleName()
Get the name of the module being executed by this instance.
dieStatus(StatusValue $status)
Throw an ApiUsageException based on the Status object.
requireOnlyOneParameter( $params, $required)
Die if none or more than one of a certain set of parameters is set and not false.
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
Allows user to patrol pages.
isWriteMode()
Indicates whether this module requires write mode.
execute()
Patrols the article or provides the reason the patrol failed.
needsToken()
Returns the token type this module requires in order to execute.
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
getHelpUrls()
Return links to more detailed help pages about the module.
getExamplesMessages()
Returns usage examples for this module.
mustBePosted()
Indicates whether this module must be called with a POST request.
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.
getUser()
Get the User object.
static newFromId( $rcid)
Obtain the recent change with a given rc_id value.
static newFromId( $id, $flags=0)
Load a page revision from a given revision ID number.
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 local account incomplete not yet checked for validity & $retval
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev