use Wikimedia\Assert\Assert;
use Wikimedia\Rdbms\Database;
use Wikimedia\Rdbms\IDatabase;
+use MediaWiki\MediaWikiServices;
/**
* Abstraction for ResourceLoader modules which pull from wiki pages
// 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,
$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,
* @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]
}
if ( $purge ) {
- $cache = ObjectCache::getMainWANInstance();
- $key = $cache->makeGlobalKey( 'resourceloader', 'titleinfo', $wikiId );
+ $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
+ $key = $cache->makeGlobalKey( 'resourceloader', 'titleinfo', $domain );
$cache->touchCheckKey( $key );
}
}