Allow CACHE_NONE as a fallback for ObjectCache::newAccelerator
authorBrad Jorsch <bjorsch@wikimedia.org>
Thu, 8 Jan 2015 12:33:38 +0000 (07:33 -0500)
committerKrinkle <krinklemail@gmail.com>
Thu, 8 Jan 2015 12:58:17 +0000 (12:58 +0000)
Test for null specifically rather than falsiness,
because CACHE_NONE is 0.

Bug: T86162
Change-Id: I98b9da42c6a5fd6cdf721cdbd5473a5e959581b8

includes/objectcache/ObjectCache.php

index 633b34a..62856f9 100644 (file)
@@ -135,7 +135,7 @@ class ObjectCache {
                } elseif ( function_exists( 'wincache_ucache_get' ) ) {
                        $id = 'wincache';
                } else {
-                       if ( $fallback ) {
+                       if ( $fallback !== null ) {
                                return self::newFromId( $fallback );
                        }
                        throw new MWException( "CACHE_ACCEL requested but no suitable object " .