X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiPurge.php;h=7667b23529d627d39966fabfa9eb68c44719168f;hb=ca28853e225fb8c3a2715c6f5bcc558d9e482590;hp=981dc18f030f72005a29ab9cf602de93a22e6e79;hpb=e91fd2fc41cca86283ba1ad9158bc87038c9a416;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php index 981dc18f03..7667b23529 100644 --- a/includes/api/ApiPurge.php +++ b/includes/api/ApiPurge.php @@ -38,6 +38,8 @@ class ApiPurge extends ApiBase { public function execute() { $params = $this->extractRequestParams(); + $this->getResult()->beginContinuation( $params['continue'], array(), array() ); + $forceLinkUpdate = $params['forcelinkupdate']; $forceRecursiveLinkUpdate = $params['forcerecursivelinkupdate']; $pageSet = $this->getPageSet(); @@ -102,6 +104,8 @@ class ApiPurge extends ApiBase { if ( $values ) { $apiResult->addValue( null, 'redirects', $values ); } + + $apiResult->endContinuation(); } /** @@ -128,7 +132,8 @@ class ApiPurge extends ApiBase { public function getAllowedParams( $flags = 0 ) { $result = array( 'forcelinkupdate' => false, - 'forcerecursivelinkupdate' => false + 'forcerecursivelinkupdate' => false, + 'continue' => '', ); if ( $flags ) { $result += $this->getPageSet()->getFinalParams( $flags ); @@ -143,55 +148,16 @@ class ApiPurge extends ApiBase { '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 getResultProperties() { - return array( - ApiBase::PROP_LIST => true, - '' => array( - 'ns' => array( - ApiBase::PROP_TYPE => 'namespace', - ApiBase::PROP_NULLABLE => true - ), - 'title' => array( - ApiBase::PROP_TYPE => 'string', - ApiBase::PROP_NULLABLE => true - ), - 'pageid' => array( - ApiBase::PROP_TYPE => 'integer', - ApiBase::PROP_NULLABLE => true - ), - 'revid' => array( - ApiBase::PROP_TYPE => 'integer', - ApiBase::PROP_NULLABLE => true - ), - 'invalid' => 'boolean', - 'special' => 'boolean', - 'missing' => 'boolean', - 'purged' => 'boolean', - 'linkupdate' => 'boolean', - 'iw' => array( - ApiBase::PROP_TYPE => 'string', - ApiBase::PROP_NULLABLE => true - ), - ) - ); - } - 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 getPossibleErrors() { - return array_merge( - parent::getPossibleErrors(), - $this->getPageSet()->getFinalPossibleErrors() - ); - } - public function getExamples() { return array( 'api.php?action=purge&titles=Main_Page|API' => 'Purge the "Main Page" and the "API" page',