},
'BlockManager' => function ( MediaWikiServices $services ) : BlockManager {
- $config = $services->getMainConfig();
$context = RequestContext::getMain();
return new BlockManager(
new ServiceOptions(
'LocalServerObjectCache' => function ( MediaWikiServices $services ) : BagOStuff {
$cacheId = \ObjectCache::detectLocalServerCache();
+
return \ObjectCache::newFromId( $cacheId );
},
wfUrlProtocols(),
$services->getSpecialPageFactory(),
$services->getLinkRendererFactory(),
- $services->getNamespaceInfo()
+ $services->getNamespaceInfo(),
+ LoggerFactory::getInstance( 'Parser' )
);
},
'SiteStore' => function ( MediaWikiServices $services ) : SiteStore {
$rawSiteStore = new DBSiteStore( $services->getDBLoadBalancer() );
- // TODO: replace wfGetCache with a CacheFactory service.
- // TODO: replace wfIsHHVM with a capabilities service.
- $cache = wfGetCache( wfIsHHVM() ? CACHE_ACCEL : CACHE_ANYTHING );
+ $cache = $services->getLocalServerObjectCache();
+ if ( $cache instanceof EmptyBagOStuff ) {
+ $cache = ObjectCache::getLocalClusterInstance();
+ }
return new CachingSiteStore( $rawSiteStore, $cache );
},