objectcache: make detectLocalServerCache() prefer apcu over apc
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 22 May 2019 16:30:50 +0000 (09:30 -0700)
committerKrinkle <krinklemail@gmail.com>
Wed, 22 May 2019 22:23:22 +0000 (22:23 +0000)
Bug: T220470
Change-Id: I8b85859b3991d2360a74107299d44da2c60d0214

includes/objectcache/ObjectCache.php

index bc87c70..c0adb51 100644 (file)
@@ -400,10 +400,10 @@ class ObjectCache {
         * @return int|string Index to cache in $wgObjectCaches
         */
        public static function detectLocalServerCache() {
-               if ( function_exists( 'apc_fetch' ) ) {
-                       return 'apc';
-               } elseif ( function_exists( 'apcu_fetch' ) ) {
+               if ( function_exists( 'apcu_fetch' ) ) {
                        return 'apcu';
+               } elseif ( function_exists( 'apc_fetch' ) ) {
+                       return 'apc';
                } elseif ( function_exists( 'wincache_ucache_get' ) ) {
                        return 'wincache';
                }