to add fields to Special:Mute.
* (T100896) Skin authors can define custom OOUI themes using OOUIThemePaths.
See <https://www.mediawiki.org/wiki/OOUI/Themes> for details.
-* The HtmlCacheUpdater service was added to unify the logic of purging CDN cache
- and HTML file cache to simplify callers and make them more consistent.
=== External library changes in 1.34 ===
* SearchEngine::textAlreadyUpdatedForIndex() is deprecated, given the
deprecation above this method is no longer needed/called and should not be
implemented by SearchEngine implementation.
-* Title::purgeSquid is deprecated. Use MediaWikiServices::getHtmlCacheUpdater.
=== Other changes in 1.34 ===
* …
'Hooks' => __DIR__ . '/includes/Hooks.php',
'Html' => __DIR__ . '/includes/Html.php',
'HtmlArmor' => __DIR__ . '/includes/libs/HtmlArmor.php',
- 'HtmlCacheUpdater' => __DIR__ . '/includes/cache/HtmlCacheUpdater.php',
- 'HtmlFileCacheUpdate' => __DIR__ . '/includes/deferred/HtmlFileCacheUpdate.php',
'Http' => __DIR__ . '/includes/http/Http.php',
'HttpError' => __DIR__ . '/includes/exception/HttpError.php',
'HttpStatus' => __DIR__ . '/includes/libs/HttpStatus.php',
use MediaWiki\Interwiki\InterwikiLookup;
use MagicWordFactory;
use MediaWiki\Storage\PageEditStash;
-use HtmlCacheUpdater;
/**
* Service locator for MediaWiki core services.
return $this->getService( 'GenderCache' );
}
- /**
- * @return HtmlCacheUpdater
- * @since 1.34
- */
- public function getHtmlCacheUpdater() {
- return $this->getService( 'HtmlCacheUpdater' );
- }
-
/**
* @since 1.31
* @return HttpRequestFactory
return new GenderCache( $services->getNamespaceInfo() );
},
- 'HtmlCacheUpdater' => function ( MediaWikiServices $services ) : HtmlCacheUpdater {
- return new HtmlCacheUpdater();
- },
-
'HttpRequestFactory' =>
function ( MediaWikiServices $services ) : HttpRequestFactory {
return new HttpRequestFactory();
/**
* Purge all applicable CDN URLs
- * @deprecated 1.34 Use HtmlCacheUpdater
*/
public function purgeSquid() {
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( $this->getCdnUrls() );
+ DeferredUpdates::addUpdate(
+ new CdnCacheUpdate( $this->getCdnUrls() ),
+ DeferredUpdates::PRESEND
+ );
}
/**
* on the number of links. Typically called on create and delete.
*/
public function touchLinks() {
- $jobs = [];
- $jobs[] = HTMLCacheUpdateJob::newForBacklinks(
- $this,
- 'pagelinks',
- [ 'causeAction' => 'page-touch' ]
- );
+ DeferredUpdates::addUpdate( new HTMLCacheUpdate( $this, 'pagelinks', 'page-touch' ) );
if ( $this->mNamespace == NS_CATEGORY ) {
- $jobs[] = HTMLCacheUpdateJob::newForBacklinks(
- $this,
- 'categorylinks',
- [ 'causeAction' => 'category-touch' ]
+ DeferredUpdates::addUpdate(
+ new HTMLCacheUpdate( $this, 'categorylinks', 'category-touch' )
);
}
-
- JobQueueGroup::singleton()->lazyPush( $jobs );
}
/**
return $text;
}
- /**
- * @param string[] $prefixedDbKeys List of prefixed DB keys for pages to purge
- * @since 1.34
- */
- public static function purge( array $prefixedDbKeys ) {
- foreach ( $prefixedDbKeys as $prefixedDbKey ) {
- foreach ( self::cacheablePageActions() as $type ) {
- $fc = new self( $prefixedDbKey, $type );
- $fc->clearCache();
- }
- }
- }
-
/**
* Clear the file caches for a page for all actions
- * @param Traversable|Title[]|Title $titles
+ * @param Title $title
* @return bool Whether $wgUseFileCache is enabled
*/
- public static function clearFileCache( $titles ) {
+ public static function clearFileCache( Title $title ) {
$config = MediaWikiServices::getInstance()->getMainConfig();
+
if ( !$config->get( 'UseFileCache' ) ) {
return false;
}
- $titleIterator = ( $titles instanceof Title ) ? [ $titles ] : $titles;
- foreach ( $titleIterator as $title ) {
- self::purge( [ $title->getPrefixedDBkey() ] );
+ foreach ( self::cacheablePageActions() as $type ) {
+ $fc = new self( $title, $type );
+ $fc->clearCache();
}
return true;
+++ /dev/null
-<?php
-/**
- * HTML/file cache invalidation of cacheable variant/action URLs for a page
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Cache
- */
-
-/**
- * Class to invalidate the HTML/file cache of cacheable variant/action URLs for a page
- *
- * @ingroup Cache
- * @since 1.34
- */
-class HtmlCacheUpdater {
- /** @var int Purge after the main transaction round and respect $wgCdnReboundPurgeDelay */
- const ISOLATION_AND_LAG_AWARE = 1;
- /** @var int Purge immediately and only once (ignore $wgCdnReboundPurgeDelay) */
- const IMMEDIATE_WITHOUT_REBOUND = 2;
-
- /**
- * Purge CDN/HTMLFileCache for a URL, Title, or iteratable of URL or Title entries
- *
- * String entries will be treated as URLs to be purged from the CDN layer.
- * For Title entries, all cacheable canonical URLs associated with the page
- * will be purged from the CDN and HTMLFileCache.
- *
- * The cache purges are queued as PRESEND deferred updates so that they run after the
- * main database transaction round of LBFactory. This reduces the chance of race conditions
- * where a stale value is re-populated before commit. Depending on $wgCdnReboundPurgeDelay,
- * a secondary set of purges might be issued several seconds later through the use of a
- * delayed job. This is used to mitigate the effects of DB replication lag as well as
- * multiple layers of CDN proxies. All deferred CDN purges are combined and de-duplicated
- * into a single DeferrableUpdate instance. This improves HTTP PURGE request pipelining.
- *
- * Use the IMMEDIATE_WITHOUT_REBOUND class constant to instantly issue the purges instead
- * and skip the use of any secondary purges regardless of $wgCdnReboundPurgeDelay.
- *
- * @param Traversable|Title[]|Title|string[]|string $entries
- * @param int $mode ISOLATION_AND_LAG_AWARE or IMMEDIATE_WITHOUT_REBOUND class constant
- */
- public function purge( $entries, $mode = self::ISOLATION_AND_LAG_AWARE ) {
- $urls = [];
- $titles = [];
- if ( is_string( $entries ) ) {
- $urls = [ $entries ];
- } elseif ( $entries instanceof Title ) {
- $titles = [ $entries ];
- } elseif ( $entries instanceof TitleArray ) {
- $titles = $entries; // save memory
- } else {
- foreach ( $entries as $entry ) {
- if ( is_string( $entry ) ) {
- $urls[] = $entry;
- } else {
- $titles[] = $entry;
- }
- }
- }
-
- if ( $mode === self::IMMEDIATE_WITHOUT_REBOUND ) {
- HTMLFileCache::clearFileCache( $titles );
- foreach ( $titles as $title ) {
- /** @var Title $title */
- $urls = array_merge( $urls, $title->getCdnUrls() );
- }
- CdnCacheUpdate::purge( $urls ); // purge once (no "rebound" purges)
- } else {
- DeferredUpdates::addUpdate(
- HtmlFileCacheUpdate::newFromTitles( $titles ),
- DeferredUpdates::PRESEND
- );
- DeferredUpdates::addUpdate(
- CdnCacheUpdate::newFromTitles( $titles, $urls ),
- DeferredUpdates::PRESEND
- );
- }
- }
-}
use MediaWiki\MediaWikiServices;
/**
- * Handles purging the appropriate CDN objects given a list of URLs or Title instances
+ * Handles purging appropriate CDN URLs given a title (or titles)
* @ingroup Cache
*/
class CdnCacheUpdate implements DeferrableUpdate, MergeableUpdate {
/** @var string[] Collection of URLs to purge */
- private $urls = [];
+ protected $urls = [];
/**
* @param string[] $urlArr Collection of URLs to purge
$urlArr = array_merge( $urlArr, $title->getCdnUrls() );
}
- return new self( $urlArr );
+ return new CdnCacheUpdate( $urlArr );
}
+ /**
+ * Purges the list of URLs passed to the constructor.
+ */
public function doUpdate() {
global $wgCdnReboundPurgeDelay;
wfDebugLog( 'squid', __METHOD__ . ': ' . implode( ' ', $urlArr ) );
// Reliably broadcast the purge to all edge nodes
+ $relayer = MediaWikiServices::getInstance()->getEventRelayerGroup()
+ ->getRelayer( 'cdn-url-purges' );
$ts = microtime( true );
- $relayerGroup = MediaWikiServices::getInstance()->getEventRelayerGroup();
- $relayerGroup->getRelayer( 'cdn-url-purges' )->notifyMulti(
+ $relayer->notifyMulti(
'cdn-url-purges',
array_map(
function ( $url ) use ( $ts ) {
*/
/**
- * Class to invalidate the HTML/file cache of all the pages linking to a given title.
+ * Class to invalidate the HTML cache of all the pages linking to a given title.
*
* @ingroup Cache
- * @deprecated Since 1.34; Enqueue jobs from HTMLCacheUpdateJob::newForBacklinks instead
*/
class HTMLCacheUpdate extends DataUpdate {
/** @var Title */
- private $title;
+ public $mTitle;
+
/** @var string */
- private $table;
+ public $mTable;
/**
- * @param Title $title
+ * @param Title $titleTo
* @param string $table
+ * @param string $causeAction Triggering action
+ * @param string $causeAgent Triggering user
*/
- public function __construct( Title $title, $table ) {
- $this->title = $title;
- $this->table = $table;
+ function __construct(
+ Title $titleTo, $table, $causeAction = 'unknown', $causeAgent = 'unknown'
+ ) {
+ $this->mTitle = $titleTo;
+ $this->mTable = $table;
+ $this->causeAction = $causeAction;
+ $this->causeAgent = $causeAgent;
}
public function doUpdate() {
$job = HTMLCacheUpdateJob::newForBacklinks(
- $this->title,
- $this->table,
+ $this->mTitle,
+ $this->mTable,
[ 'causeAction' => $this->getCauseAction(), 'causeAgent' => $this->getCauseAgent() ]
);
+
JobQueueGroup::singleton()->lazyPush( $job );
}
}
+++ /dev/null
-<?php
-/**
- * HTMLFileCache cache purging
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- */
-
-use MediaWiki\MediaWikiServices;
-
-/**
- * Handles purging the appropriate HTMLFileCache files given a list of titles
- * @ingroup Cache
- */
-class HtmlFileCacheUpdate implements DeferrableUpdate {
- /** @var string[] Collection of prefixed DB keys for the pages to purge */
- private $prefixedDbKeys = [];
-
- /**
- * @param string[] $prefixedDbKeys
- */
- public function __construct( array $prefixedDbKeys ) {
- $this->prefixedDbKeys = $prefixedDbKeys;
- }
-
- /**
- * Create an update object from an array of Title objects, or a TitleArray object
- *
- * @param Traversable|Title[] $titles
- * @return HtmlFileCacheUpdate
- */
- public static function newFromTitles( $titles ) {
- $prefixedDbKeys = [];
- foreach ( $titles as $title ) {
- $prefixedDbKeys[] = $title->getPrefixedDBkey();
- }
-
- return new self( $prefixedDbKeys );
- }
-
- public function doUpdate() {
- $config = MediaWikiServices::getInstance()->getMainConfig();
- if ( $config->get( 'UseFileCache' ) ) {
- HTMLFileCache::purge( $this->prefixedDbKeys );
- }
- }
-}
private function invalidateProperties( $changed ) {
global $wgPagePropLinkInvalidations;
- $jobs = [];
foreach ( $changed as $name => $value ) {
if ( isset( $wgPagePropLinkInvalidations[$name] ) ) {
$inv = $wgPagePropLinkInvalidations[$name];
$inv = [ $inv ];
}
foreach ( $inv as $table ) {
- $jobs[] = HTMLCacheUpdateJob::newForBacklinks(
- $this->mTitle,
- $table,
- [ 'causeAction' => 'page-props' ]
+ DeferredUpdates::addUpdate(
+ new HTMLCacheUpdate( $this->mTitle, $table, 'page-props' )
);
}
}
}
-
- JobQueueGroup::singleton()->lazyPush( $jobs );
}
/**
$title = $this->getTitle();
if ( $title ) {
$title->invalidateCache();
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( $title );
+ $title->purgeSquid();
}
}
// Purge cache of all pages using this file
$title = $this->getTitle();
if ( $title ) {
- $job = HTMLCacheUpdateJob::newForBacklinks(
- $title,
- 'imagelinks',
- [ 'causeAction' => 'file-purge' ]
+ DeferredUpdates::addUpdate(
+ new HTMLCacheUpdate( $title, 'imagelinks', 'file-purge' )
);
- JobQueueGroup::singleton()->lazyPush( $job );
}
}
$this->purgeThumbnails( $options );
// Purge CDN cache for this file
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( $this->getUrl() );
+ DeferredUpdates::addUpdate(
+ new CdnCacheUpdate( [ $this->getUrl() ] ),
+ DeferredUpdates::PRESEND
+ );
}
/**
foreach ( $files as $file ) {
$urls[] = $this->getArchiveThumbUrl( $archiveName, $file );
}
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( $urls );
+ DeferredUpdates::addUpdate( new CdnCacheUpdate( $urls ), DeferredUpdates::PRESEND );
}
/**
$this->purgeThumbList( $dir, $files );
// Purge the CDN
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( $urls );
+ DeferredUpdates::addUpdate( new CdnCacheUpdate( $urls ), DeferredUpdates::PRESEND );
}
/**
}
} else {
# Existing file page: invalidate description page cache
- $title = $wikiPage->getTitle();
- $title->invalidateCache();
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( $title );
+ $wikiPage->getTitle()->invalidateCache();
+ $wikiPage->getTitle()->purgeSquid();
# Allow the new file version to be patrolled from the page footer
Article::purgePatrolFooterCache( $descId );
}
# Delete old thumbnails
$this->purgeThumbnails();
# Remove the old file from the CDN cache
- MediaWikiServices::getInstance()
- ->getHtmlCacheUpdater()->purge( $this->getUrl() );
+ DeferredUpdates::addUpdate(
+ new CdnCacheUpdate( [ $this->getUrl() ] ),
+ DeferredUpdates::PRESEND
+ );
} else {
# Update backlink pages pointing to this title if created
LinksUpdate::queueRecursiveJobsForTable(
}
# Invalidate cache for all pages using this file
- $job = HTMLCacheUpdateJob::newForBacklinks(
- $this->getTitle(),
- 'imagelinks',
- [ 'causeAction' => 'file-upload', 'causeAgent' => $user->getName() ]
+ DeferredUpdates::addUpdate(
+ new HTMLCacheUpdate( $this->getTitle(), 'imagelinks', 'file-upload' )
);
- JobQueueGroup::singleton()->lazyPush( $job );
return Status::newGood();
}
foreach ( $archiveNames as $archiveName ) {
$purgeUrls[] = $this->getArchiveUrl( $archiveName );
}
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( $purgeUrls );
+ DeferredUpdates::addUpdate( new CdnCacheUpdate( $purgeUrls ), DeferredUpdates::PRESEND );
return $status;
}
$this->purgeDescription();
}
- $url = $this->getArchiveUrl( $archiveName );
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( $url );
+ DeferredUpdates::addUpdate(
+ new CdnCacheUpdate( [ $this->getArchiveUrl( $archiveName ) ] ),
+ DeferredUpdates::PRESEND
+ );
return $status;
}
use MediaWiki\MediaWikiServices;
/**
- * Job to purge the HTML/file cache for all pages that link to or use another page or file
+ * Job to purge the cache for all pages that link to or use another page or file
*
* This job comes in a few variants:
* - a) Recursive jobs to purge caches for backlink pages for a given title.
* @param array $pages Map of (page ID => (namespace, DB key)) entries
*/
protected function invalidateTitles( array $pages ) {
- global $wgUpdateRowsPerQuery, $wgPageLanguageUseDB;
+ global $wgUpdateRowsPerQuery, $wgUseFileCache, $wgPageLanguageUseDB;
// Get all page IDs in this query into an array
$pageIds = array_keys( $pages );
__METHOD__
) );
- // Update CDN and file caches (avoiding secondary purge overhead)
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge(
- $titleArray,
- HtmlCacheUpdater::IMMEDIATE_WITHOUT_REBOUND
- );
+ // Update CDN; call purge() directly so as to not bother with secondary purges
+ $urls = [];
+ foreach ( $titleArray as $title ) {
+ /** @var Title $title */
+ $urls = array_merge( $urls, $title->getCdnUrls() );
+ }
+ CdnCacheUpdate::purge( $urls );
+
+ // Update file cache
+ if ( $wgUseFileCache ) {
+ foreach ( $titleArray as $title ) {
+ HTMLFileCache::clearFileCache( $title );
+ }
+ }
}
public function getDeduplicationInfo() {
Hooks::run( 'ArticleUndelete',
[ &$this->title, $created, $comment, $oldPageId, $restoredPages ] );
-
if ( $this->title->getNamespace() == NS_FILE ) {
- $job = HTMLCacheUpdateJob::newForBacklinks(
- $this->title,
- 'imagelinks',
- [ 'causeAction' => 'imagelinks', 'causeAgent' => 'file-restore' ]
+ DeferredUpdates::addUpdate(
+ new HTMLCacheUpdate( $this->title, 'imagelinks', 'file-restore' )
);
- JobQueueGroup::singleton()->lazyPush( $job );
}
}
if ( $this->mFile->exists() ) {
wfDebug( 'ImagePage::doPurge purging ' . $this->mFile->getName() . "\n" );
- $job = HTMLCacheUpdateJob::newForBacklinks(
- $this->mTitle,
- 'imagelinks',
- [ 'causeAction' => 'file-purge' ]
+ DeferredUpdates::addUpdate(
+ new HTMLCacheUpdate( $this->mTitle, 'imagelinks', 'file-purge' )
);
- JobQueueGroup::singleton()->lazyPush( $job );
} else {
wfDebug( 'ImagePage::doPurge no image for '
. $this->mFile->getName() . "; limiting purge to cache only\n" );
$this->mTitle->invalidateCache();
- // Clear file cache and send purge after above page_touched update was committed
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( $this->mTitle );
+ // Clear file cache
+ HTMLFileCache::clearFileCache( $this->getTitle() );
+ // Send purge after above page_touched update was committed
+ DeferredUpdates::addUpdate(
+ new CdnCacheUpdate( $this->mTitle->getCdnUrls() ),
+ DeferredUpdates::PRESEND
+ );
if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
$messageCache = MessageCache::singleton();
// Update existence markers on article/talk tabs...
$other = $title->getOtherPage();
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( [ $title, $other ] );
+ $other->purgeSquid();
$title->touchLinks();
+ $title->purgeSquid();
$title->deleteTitleProtection();
MediaWikiServices::getInstance()->getLinkCache()->invalidateTitle( $title );
// Invalidate caches of articles which include this page
- $job = HTMLCacheUpdateJob::newForBacklinks(
- $title,
- 'templatelinks',
- [ 'causeAction' => 'page-create' ]
+ DeferredUpdates::addUpdate(
+ new HTMLCacheUpdate( $title, 'templatelinks', 'page-create' )
);
- JobQueueGroup::singleton()->lazyPush( $job );
if ( $title->getNamespace() == NS_CATEGORY ) {
// Load the Category object, which will schedule a job to create
// TODO: move this into a PageEventEmitter service
// Update existence markers on article/talk tabs...
+ // Clear Backlink cache first so that purge jobs use more up-to-date backlink information
+ BacklinkCache::get( $title )->clear();
$other = $title->getOtherPage();
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( [ $title, $other ] );
+ $other->purgeSquid();
$title->touchLinks();
+ $title->purgeSquid();
MediaWikiServices::getInstance()->getLinkCache()->invalidateTitle( $title );
+ // File cache
+ HTMLFileCache::clearFileCache( $title );
InfoAction::invalidateCache( $title );
// Messages
// Images
if ( $title->getNamespace() == NS_FILE ) {
- $job = HTMLCacheUpdateJob::newForBacklinks(
- $title,
- 'imagelinks',
- [ 'causeAction' => 'page-delete' ]
+ DeferredUpdates::addUpdate(
+ new HTMLCacheUpdate( $title, 'imagelinks', 'page-delete' )
);
- JobQueueGroup::singleton()->lazyPush( $job );
}
// User talk pages
) {
// TODO: move this into a PageEventEmitter service
- $jobs = [];
- if ( $slotsChanged === null || in_array( SlotRecord::MAIN, $slotsChanged ) ) {
+ if ( $slotsChanged === null || in_array( SlotRecord::MAIN, $slotsChanged ) ) {
// Invalidate caches of articles which include this page.
// Only for the main slot, because only the main slot is transcluded.
// TODO: MCR: not true for TemplateStyles! [SlotHandler]
- $jobs[] = HTMLCacheUpdateJob::newForBacklinks(
- $title,
- 'templatelinks',
- [ 'causeAction' => 'page-edit' ]
+ DeferredUpdates::addUpdate(
+ new HTMLCacheUpdate( $title, 'templatelinks', 'page-edit' )
);
}
+
// Invalidate the caches of all pages which redirect here
- $jobs[] = HTMLCacheUpdateJob::newForBacklinks(
- $title,
- 'redirect',
- [ 'causeAction' => 'page-edit' ]
+ DeferredUpdates::addUpdate(
+ new HTMLCacheUpdate( $title, 'redirect', 'page-edit' )
);
- JobQueueGroup::singleton()->lazyPush( $jobs );
MediaWikiServices::getInstance()->getLinkCache()->invalidateTitle( $title );
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( $title );
+ // Purge CDN for this page only
+ $title->purgeSquid();
+ // Clear file cache for this page only
+ HTMLFileCache::clearFileCache( $title );
// Purge ?action=info cache
$revid = $revision ? $revision->getId() : null;
$file->purgeOldThumbnails( $archiveName );
$purgeUrls[] = $file->getArchiveUrl( $archiveName );
}
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( $purgeUrls );
+ DeferredUpdates::addUpdate(
+ new CdnCacheUpdate( $purgeUrls ),
+ DeferredUpdates::PRESEND
+ );
return Status::newGood();
}
* @ingroup RevisionDelete
*/
-use MediaWiki\MediaWikiServices;
use MediaWiki\Storage\RevisionRecord;
use Wikimedia\Rdbms\FakeResultWrapper;
use Wikimedia\Rdbms\IDatabase;
}
public function doPostCommitUpdates( array $visibilityChangeMap ) {
- MediaWikiServices::getInstance()->getHtmlCacheUpdater()->purge( $this->title );
+ $this->title->purgeSquid();
// Extensions that require referencing previous revisions may need this
- Hooks::run( 'ArticleRevisionVisibilitySet',
- [ $this->title, $this->ids, $visibilityChangeMap ] );
+ Hooks::run( 'ArticleRevisionVisibilitySet', [ $this->title, $this->ids, $visibilityChangeMap ] );
return Status::newGood();
}
}