summaryrefslogtreecommitdiff
path: root/includes/api/ApiPurge.php
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:30:02 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-05-01 15:30:02 -0400
commit1de335ad3f395ca6861085393ba366a9e3fb4a0d (patch)
treef1fdd326034e05177596851be6a7127615d81498 /includes/api/ApiPurge.php
parent9c75fa8ff6d4d38ef552c00fef5969fb154765e8 (diff)
parentf6d65e533c62f6deb21342d4901ece24497b433e (diff)
Merge commit 'f6d65'
# Conflicts: # skins/ArchLinux/ArchLinux.php
Diffstat (limited to 'includes/api/ApiPurge.php')
-rw-r--r--includes/api/ApiPurge.php39
1 files changed, 15 insertions, 24 deletions
diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php
index 7667b235..a22be498 100644
--- a/includes/api/ApiPurge.php
+++ b/includes/api/ApiPurge.php
@@ -38,7 +38,8 @@ class ApiPurge extends ApiBase {
public function execute() {
$params = $this->extractRequestParams();
- $this->getResult()->beginContinuation( $params['continue'], array(), array() );
+ $continuationManager = new ApiContinuationManager( $this, array(), array() );
+ $this->setContinuationManager( $continuationManager );
$forceLinkUpdate = $params['forcelinkupdate'];
$forceRecursiveLinkUpdate = $params['forcerecursivelinkupdate'];
@@ -52,7 +53,7 @@ class ApiPurge extends ApiBase {
ApiQueryBase::addTitleInfo( $r, $title );
$page = WikiPage::factory( $title );
$page->doPurge(); // Directly purge and skip the UI part of purge().
- $r['purged'] = '';
+ $r['purged'] = true;
if ( $forceLinkUpdate || $forceRecursiveLinkUpdate ) {
if ( !$this->getUser()->pingLimiter( 'linkpurge' ) ) {
@@ -73,7 +74,7 @@ class ApiPurge extends ApiBase {
$title, null, $forceRecursiveLinkUpdate, $p_result );
DataUpdate::runUpdates( $updates );
- $r['linkupdate'] = '';
+ $r['linkupdate'] = true;
if ( $enableParserCache ) {
$pcache = ParserCache::singleton();
@@ -89,7 +90,7 @@ class ApiPurge extends ApiBase {
$result[] = $r;
}
$apiResult = $this->getResult();
- $apiResult->setIndexedTagName( $result, 'page' );
+ ApiResult::setIndexedTagName( $result, 'page' );
$apiResult->addValue( null, $this->getModuleName(), $result );
$values = $pageSet->getNormalizedTitlesAsResult( $apiResult );
@@ -105,7 +106,8 @@ class ApiPurge extends ApiBase {
$apiResult->addValue( null, 'redirects', $values );
}
- $apiResult->endContinuation();
+ $this->setContinuationManager( null );
+ $continuationManager->setContinuationIntoResult( $apiResult );
}
/**
@@ -133,7 +135,9 @@ class ApiPurge extends ApiBase {
$result = array(
'forcelinkupdate' => false,
'forcerecursivelinkupdate' => false,
- 'continue' => '',
+ 'continue' => array(
+ ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
+ ),
);
if ( $flags ) {
$result += $this->getPageSet()->getFinalParams( $flags );
@@ -142,25 +146,12 @@ class ApiPurge extends ApiBase {
return $result;
}
- public function getParamDescription() {
- return $this->getPageSet()->getFinalParamDescription()
- + array(
- 'forcelinkupdate' => 'Update the links tables',
- 'forcerecursivelinkupdate' => 'Update the links table, and update ' .
- 'the links tables for any page that uses this page as a template',
- 'continue' => 'When more results are available, use this to continue',
- );
- }
-
- public function getDescription() {
- return array( 'Purge the cache for the given titles.',
- 'Requires a POST request if the user is not logged in.'
- );
- }
-
- public function getExamples() {
+ protected function getExamplesMessages() {
return array(
- 'api.php?action=purge&titles=Main_Page|API' => 'Purge the "Main Page" and the "API" page',
+ 'action=purge&titles=Main_Page|API'
+ => 'apihelp-purge-example-simple',
+ 'action=purge&generator=allpages&gapnamespace=0&gaplimit=10'
+ => 'apihelp-purge-example-generator',
);
}