* Purges the cache of a page
*/
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.' );
+ }
+
$params = $this->extractRequestParams();
$continuationManager = new ApiContinuationManager( $this, [], [] );
$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 );
}
return !$this->getUser()->isAllowed( 'purge' );
}
+ protected function getHelpFlags() {
+ $flags = parent::getHelpFlags();
+
+ // Claim that we must be posted for the purposes of help and paraminfo.
+ // @todo Remove this when self::mustBePosted() is updated for T145649
+ if ( !in_array( 'mustbeposted', $flags, true ) ) {
+ $flags[] = 'mustbeposted';
+ }
+
+ return $flags;
+ }
+
public function getAllowedParams( $flags = 0 ) {
$result = [
'forcelinkupdate' => false,