public function execute() {
$main = $this->getMain();
if ( !$main->isInternalMode() && !$main->getRequest()->wasPosted() ) {
- $this->logFeatureUsage( 'purge-via-GET' );
- $this->setWarning( 'Use of action=purge via GET is deprecated. Use POST instead.' );
+ $this->addDeprecation( 'apiwarn-deprecation-purge-get', 'purge-via-GET' );
}
$params = $this->extractRequestParams();
$page->doPurge( $flags );
$r['purged'] = true;
} else {
- $error = $this->parseMsg( [ 'actionthrottledtext' ] );
- $this->setWarning( $error['info'] );
+ $this->addWarning( 'apierror-ratelimited' );
}
if ( $forceLinkUpdate || $forceRecursiveLinkUpdate ) {
$updates = $content->getSecondaryDataUpdates(
$title, null, $forceRecursiveLinkUpdate, $p_result );
foreach ( $updates as $update ) {
- # Some extensions, like EventBus, need to know the user
- # that performed the purge action, so set it here
- if ( $update instanceof LinksUpdate ) {
- $update->setTriggeringUser( $user );
- }
DeferredUpdates::addUpdate( $update, DeferredUpdates::PRESEND );
}
}
}
} else {
- $error = $this->parseMsg( [ 'actionthrottledtext' ] );
- $this->setWarning( $error['info'] );
+ $this->addWarning( 'apierror-ratelimited' );
$forceLinkUpdate = false;
}
}