X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fresourceloader%2FResourceLoaderWikiModule.php;h=9fad3487f2636c48aaef9bba79ed364d94c08b2a;hb=a38af7ba26579bb3004f673e44d39710887763aa;hp=fe77576cede851696d47b768570251b9af6af9b4;hpb=e548e0f35c4b47a0de4903e8a3758c2b2d9e2712;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/resourceloader/ResourceLoaderWikiModule.php b/includes/resourceloader/ResourceLoaderWikiModule.php index fe77576ced..9fad3487f2 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 @@ -432,7 +433,7 @@ class ResourceLoaderWikiModule extends ResourceLoaderModule { // Avoid including ids or timestamps of revision/page tables so // that versions are not wasted $title = new TitleValue( (int)$row->page_namespace, $row->page_title ); - $titleInfo[ self::makeTitleKey( $title ) ] = [ + $titleInfo[self::makeTitleKey( $title )] = [ 'page_len' => $row->page_len, 'page_latest' => $row->page_latest, 'page_touched' => $row->page_touched, @@ -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 ); } }