summaryrefslogtreecommitdiff
path: root/includes/api/ApiPurge.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-01-18 16:46:04 +0100
committerPierre Schmitz <pierre@archlinux.de>2013-01-18 16:46:04 +0100
commit63601400e476c6cf43d985f3e7b9864681695ed4 (patch)
treef7846203a952e38aaf66989d0a4702779f549962 /includes/api/ApiPurge.php
parent8ff01378c9e0207f9169b81966a51def645b6a51 (diff)
Update to MediaWiki 1.20.2
this update includes: * adjusted Arch Linux skin * updated FluxBBAuthPlugin * patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024
Diffstat (limited to 'includes/api/ApiPurge.php')
-rw-r--r--includes/api/ApiPurge.php38
1 files changed, 33 insertions, 5 deletions
diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php
index 9e9320fb..9fedaf1b 100644
--- a/includes/api/ApiPurge.php
+++ b/includes/api/ApiPurge.php
@@ -88,13 +88,13 @@ class ApiPurge extends ApiBase {
if ( !$user->pingLimiter() ) {
global $wgParser, $wgEnableParserCache;
- $popts = ParserOptions::newFromContext( $this->getContext() );
+ $popts = $page->makeParserOptions( 'canonical' );
$p_result = $wgParser->parse( $page->getRawText(), $title, $popts,
true, true, $page->getLatest() );
# Update the links tables
- $u = new LinksUpdate( $title, $p_result );
- $u->doUpdate();
+ $updates = $p_result->getSecondaryDataUpdates( $title );
+ DataUpdate::runUpdates( $updates );
$r['linkupdate'] = '';
@@ -103,7 +103,8 @@ class ApiPurge extends ApiBase {
$pcache->save( $p_result, $page, $popts );
}
} else {
- $this->setWarning( $this->parseMsg( array( 'actionthrottledtext' ) ) );
+ $error = $this->parseMsg( array( 'actionthrottledtext' ) );
+ $this->setWarning( $error['info'] );
$forceLinkUpdate = false;
}
}
@@ -133,6 +134,34 @@ class ApiPurge extends ApiBase {
);
}
+ 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',
+ 'missing' => 'boolean',
+ 'purged' => 'boolean',
+ 'linkupdate' => 'boolean'
+ )
+ );
+ }
+
public function getDescription() {
return array( 'Purge the cache for the given titles.',
'Requires a POST request if the user is not logged in.'
@@ -143,7 +172,6 @@ class ApiPurge extends ApiBase {
$psModule = new ApiPageSet( $this );
return array_merge(
parent::getPossibleErrors(),
- array( array( 'cantpurge' ), ),
$psModule->getPossibleErrors()
);
}