X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles_versions%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=blobdiff_plain;f=includes%2Fpage%2FWikiPage.php;h=24cc8b577968e1ba3d18dcccc6555fb03fbdc715;hb=e548e0f35c4b47a0de4903e8a3758c2b2d9e2712;hp=ba2d511978eb4d5631be47f5028fc8b915bdc48c;hpb=4c99a4b055522fe5d17ade1bce7203bc2f16a4c3;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index ba2d511978..24cc8b5779 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -3152,6 +3152,9 @@ class WikiPage implements Page, IDBAccessObject { // Image redirects RepoGroup::singleton()->getLocalRepo()->invalidateImageRedirect( $title ); + + // Purge cross-wiki cache entities referencing this page + self::purgeInterwikiCheckKey( $title ); } /** @@ -3190,14 +3193,41 @@ class WikiPage implements Page, IDBAccessObject { // Clear file cache for this page only HTMLFileCache::clearFileCache( $title ); + // Purge ?action=info cache $revid = $revision ? $revision->getId() : null; DeferredUpdates::addCallableUpdate( function () use ( $title, $revid ) { InfoAction::invalidateCache( $title, $revid ); } ); + + // Purge cross-wiki cache entities referencing this page + self::purgeInterwikiCheckKey( $title ); } /**#@-*/ + /** + * Purge the check key for cross-wiki cache entries referencing this page + * + * @param Title $title + */ + private static function purgeInterwikiCheckKey( Title $title ) { + global $wgEnableScaryTranscluding; + + if ( !$wgEnableScaryTranscluding ) { + return; // @todo: perhaps this wiki is only used as a *source* for content? + } + + DeferredUpdates::addCallableUpdate( function () use ( $title ) { + $cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); + $cache->resetCheckKey( + // Do not include the namespace since there can be multiple aliases to it + // due to different namespace text definitions on different wikis. This only + // means that some cache invalidations happen that are not strictly needed. + $cache->makeGlobalKey( 'interwiki-page', wfWikiID(), $title->getDBkey() ) + ); + } ); + } + /** * Returns a list of categories this page is a member of. * Results will include hidden categories