Inherits ApiBase.
Public Member Functions | |
__construct ($main, $action) | |
execute () | |
Extracts the title, token, and reason from the request parameters and invokes the local delete() function with these as arguments. | |
mustBePosted () | |
Indicates whether this module must be called with a POST request. | |
isWriteMode () | |
Indicates whether this module requires write mode. | |
getAllowedParams () | |
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (array with PARAM_* constants as keys) Don't call this function directly: use getFinalParams() to allow hooks to modify parameters as needed. | |
getParamDescription () | |
Returns an array of parameter descriptions. | |
getDescription () | |
Returns the description string for this module. | |
getVersion () | |
Returns a string that identifies the version of the extending class. | |
Static Public Member Functions | |
static | delete (&$article, $token, &$reason=NULL) |
We have our own delete() function, since Article.php's implementation is split in two phases. | |
static | deleteFile ($token, &$title, $oldimage, &$reason=NULL, $suppress=false) |
Protected Member Functions | |
getExamples () | |
Returns usage examples for this module. | |
Static Private Member Functions | |
static | getPermissionsError (&$title, $token) |
The API eqivalent of action=delete. Requires API write mode to be enabled.
Definition at line 37 of file ApiDelete.php.
ApiDelete::__construct | ( | $ | main, | |
$ | action | |||
) |
static ApiDelete::delete | ( | &$ | article, | |
$ | token, | |||
&$ | reason = NULL | |||
) | [static] |
We have our own delete() function, since Article.php's implementation is split in two phases.
Article | $article - Article object to work on | |
string | $token - Delete token (same as edit token) | |
string | $reason - Reason for the deletion. Autogenerated if NULL |
Definition at line 122 of file ApiDelete.php.
References $error, $reason, $title, $wgUser, ApiBase::dieUsageMsg(), getPermissionsError(), and wfRunHooks().
Referenced by execute().
static ApiDelete::deleteFile | ( | $ | token, | |
&$ | title, | |||
$ | oldimage, | |||
&$ | reason = NULL , |
|||
$ | suppress = false | |||
) | [static] |
Definition at line 152 of file ApiDelete.php.
References $file, $reason, $title, FileRepo::FIND_IGNORE_REDIRECT, getPermissionsError(), FileDeleteForm::haveDeletableFile(), FileDeleteForm::isValidOldSpec(), RepoGroup::singleton(), and wfFindFile().
Referenced by execute().
ApiDelete::execute | ( | ) |
Extracts the title, token, and reason from the request parameters and invokes the local delete() function with these as arguments.
It does not make use of the delete function specified by Article.php. If the deletion succeeds, the details of the article deleted and the reason for deletion are added to the result object.
Reimplemented from ApiBase.
Definition at line 50 of file ApiDelete.php.
References $reason, $wgDeleteRevisionsLimit, $wgUser, delete(), deleteFile(), ApiBase::dieUsageMsg(), ApiBase::extractRequestParams(), ApiBase::getModuleName(), ApiBase::getResult(), Title::newFromID(), Title::newFromText(), and ApiBase::requireOnlyOneParameter().
ApiDelete::getAllowedParams | ( | ) |
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (array with PARAM_* constants as keys) Don't call this function directly: use getFinalParams() to allow hooks to modify parameters as needed.
Reimplemented from ApiBase.
Definition at line 184 of file ApiDelete.php.
ApiDelete::getDescription | ( | ) |
Returns the description string for this module.
Reimplemented from ApiBase.
Definition at line 210 of file ApiDelete.php.
ApiDelete::getExamples | ( | ) | [protected] |
Returns usage examples for this module.
Return null if no examples are available.
Reimplemented from ApiBase.
Definition at line 216 of file ApiDelete.php.
ApiDelete::getParamDescription | ( | ) |
Returns an array of parameter descriptions.
Don't call this functon directly: use getFinalParamDescription() to allow hooks to modify descriptions as needed.
Reimplemented from ApiBase.
Definition at line 198 of file ApiDelete.php.
static ApiDelete::getPermissionsError | ( | &$ | title, | |
$ | token | |||
) | [static, private] |
Definition at line 101 of file ApiDelete.php.
References $title, and $wgUser.
Referenced by delete(), and deleteFile().
ApiDelete::getVersion | ( | ) |
Returns a string that identifies the version of the extending class.
Typically includes the class name, the svn revision, timestamp, and last author. Usually done with SVN's Id keyword
Reimplemented from ApiBase.
Definition at line 223 of file ApiDelete.php.
ApiDelete::isWriteMode | ( | ) |
Indicates whether this module requires write mode.
Reimplemented from ApiBase.
Definition at line 180 of file ApiDelete.php.
ApiDelete::mustBePosted | ( | ) |
Indicates whether this module must be called with a POST request.
Reimplemented from ApiBase.
Definition at line 178 of file ApiDelete.php.