* Purpose: Ephemeral global storage.
* Stored centrally within the primary data-center.
* Changes are applied there first and replicated to other DCs (best-effort).
- * To retrieve the latest value (e.g. not from a slave), use BagOStuff::READ_LATEST.
+ * To retrieve the latest value (e.g. not from a replica DB), use BagOStuff::READ_LATEST.
* This store may be subject to LRU style evictions.
*
* - ObjectCache::getInstance( $cacheType )
}
}
- try {
- // Make sure we actually have a DB backend before falling back to CACHE_DB
- MediaWikiServices::getInstance()->getDBLoadBalancer();
- $candidate = CACHE_DB;
- } catch ( ServiceDisabledException $e ) {
+ if ( MediaWikiServices::getInstance()->isServiceDisabled( 'DBLoadBalancer' ) ) {
// The LoadBalancer is disabled, probably because
// MediaWikiServices::disableStorageBackend was called.
$candidate = CACHE_NONE;
+ } else {
+ $candidate = CACHE_DB;
}
return self::getInstance( $candidate );
* ObjectCache::getLocalServerInstance( $fallbackType );
*
* // From $wgObjectCaches via newFromParams()
- * ObjectCache::getLocalServerInstance( array( 'fallback' => $fallbackType ) );
+ * ObjectCache::getLocalServerInstance( [ 'fallback' => $fallbackType ] );
*
* @param int|string|array $fallback Fallback cache or parameter map with 'fallback'
* @return BagOStuff
* @param array $params [optional] Array key 'fallback' for $fallback.
* @param int|string $fallback Fallback cache, e.g. (CACHE_NONE, "hash") (since 1.24)
* @return BagOStuff
- * @deprecated 1.27
+ * @deprecated since 1.27
*/
public static function newAccelerator( $params = [], $fallback = null ) {
if ( $fallback === null ) {