This means SiteStore now uses APCu on PHP7 as well. Previously it only
used APC on HHVM, and used the main cache (e.g. Memcached) on PHP7.
Change-Id: I83ff1d2dd61c611c9976c6f9ca8026a0b6dd6662
'LocalServerObjectCache' => function ( MediaWikiServices $services ) : BagOStuff {
$cacheId = \ObjectCache::detectLocalServerCache();
'LocalServerObjectCache' => function ( MediaWikiServices $services ) : BagOStuff {
$cacheId = \ObjectCache::detectLocalServerCache();
return \ObjectCache::newFromId( $cacheId );
},
return \ObjectCache::newFromId( $cacheId );
},
'SiteStore' => function ( MediaWikiServices $services ) : SiteStore {
$rawSiteStore = new DBSiteStore( $services->getDBLoadBalancer() );
'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 );
},
return new CachingSiteStore( $rawSiteStore, $cache );
},