* @return Content|null
*/
protected function getContentObj( Title $title ) {
- $revision = Revision::newKnownCurrent( wfGetDB( DB_REPLICA ), $title->getArticleID(),
- $title->getLatestRevID() );
+ $revision = Revision::newKnownCurrent( wfGetDB( DB_REPLICA ), $title );
if ( !$revision ) {
return null;
}
- $revision->setTitle( $title );
$content = $revision->getContent( Revision::RAW );
if ( !$content ) {
wfDebugLog( 'resourceloader', __METHOD__ . ': failed to load content of JS/CSS page!' );
if ( $module instanceof self ) {
$mDB = $module->getDB();
// Subclasses may disable getDB and implement getTitleInfo differently
- if ( $mDB && $mDB->getWikiID() === $db->getWikiID() ) {
+ if ( $mDB && $mDB->getDomainID() === $db->getDomainID() ) {
$wikiModules[] = $module;
$allPages += $module->getPages( $context );
}
$cache = ObjectCache::getMainWANInstance();
$allInfo = $cache->getWithSetCallback(
- $cache->makeGlobalKey( 'resourceloader', 'titleinfo', $db->getWikiID(), $hash ),
+ $cache->makeGlobalKey( 'resourceloader', 'titleinfo', $db->getDomainID(), $hash ),
$cache::TTL_HOUR,
function ( $curVal, &$ttl, array &$setOpts ) use ( $func, $pageNames, $db, $fname ) {
$setOpts += Database::getCacheSetOptions( $db );
return call_user_func( $func, $db, $pageNames, $fname );
},
- [ 'checkKeys' => [ $cache->makeGlobalKey( 'resourceloader', 'titleinfo', $db->getWikiID() ) ] ]
+ [
+ 'checkKeys' => [
+ $cache->makeGlobalKey( 'resourceloader', 'titleinfo', $db->getDomainID() ) ]
+ ]
);
foreach ( $wikiModules as $wikiModule ) {