X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fresourceloader%2FResourceLoaderWikiModule.php;h=a91537fb321b6380fe06316143782e44275add61;hb=c5ffaf22539f0c5e422831332081c03ae92ca304;hp=fe77576cede851696d47b768570251b9af6af9b4;hpb=f6fee6ff0f244c38750fdce5ce97035020b52261;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/resourceloader/ResourceLoaderWikiModule.php b/includes/resourceloader/ResourceLoaderWikiModule.php index fe77576ced..a91537fb32 100644 --- a/includes/resourceloader/ResourceLoaderWikiModule.php +++ b/includes/resourceloader/ResourceLoaderWikiModule.php @@ -26,6 +26,7 @@ use MediaWiki\Linker\LinkTarget; use Wikimedia\Assert\Assert; use Wikimedia\Rdbms\Database; use Wikimedia\Rdbms\IDatabase; +use MediaWiki\MediaWikiServices; /** * Abstraction for ResourceLoader modules which pull from wiki pages @@ -482,7 +483,7 @@ class ResourceLoaderWikiModule extends ResourceLoaderModule { $func = [ static::class, 'fetchTitleInfo' ]; $fname = __METHOD__; - $cache = ObjectCache::getMainWANInstance(); + $cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); $allInfo = $cache->getWithSetCallback( $cache->makeGlobalKey( 'resourceloader', 'titleinfo', $db->getDomainID(), $hash ), $cache::TTL_HOUR, @@ -528,15 +529,15 @@ class ResourceLoaderWikiModule extends ResourceLoaderModule { * @param Title $title * @param Revision|null $old Prior page revision * @param Revision|null $new New page revision - * @param string $wikiId + * @param string $domain Database domain ID * @since 1.28 */ public static function invalidateModuleCache( - Title $title, Revision $old = null, Revision $new = null, $wikiId + Title $title, Revision $old = null, Revision $new = null, $domain ) { static $formats = [ CONTENT_FORMAT_CSS, CONTENT_FORMAT_JAVASCRIPT ]; - Assert::parameterType( 'string', $wikiId, '$wikiId' ); + Assert::parameterType( 'string', $domain, '$domain' ); // TODO: MCR: differentiate between page functionality and content model! // Not all pages containing CSS or JS have to be modules! [PageType] @@ -549,8 +550,8 @@ class ResourceLoaderWikiModule extends ResourceLoaderModule { } if ( $purge ) { - $cache = ObjectCache::getMainWANInstance(); - $key = $cache->makeGlobalKey( 'resourceloader', 'titleinfo', $wikiId ); + $cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); + $key = $cache->makeGlobalKey( 'resourceloader', 'titleinfo', $domain ); $cache->touchCheckKey( $key ); } }