Merge "Add checkDependencies.php"
[lhc/web/wiklou.git] / includes / objectcache / ObjectCache.php
index dc8b146..c0adb51 100644 (file)
@@ -238,7 +238,6 @@ class ObjectCache {
                global $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType;
                $candidates = [ $wgMainCacheType, $wgMessageCacheType, $wgParserCacheType ];
                foreach ( $candidates as $candidate ) {
-                       $cache = false;
                        if ( $candidate !== CACHE_NONE && $candidate !== CACHE_ANYTHING ) {
                                $cache = self::getInstance( $candidate );
                                // CACHE_ACCEL might default to nothing if no APCu
@@ -327,14 +326,6 @@ class ObjectCache {
                global $wgCommandLineMode;
 
                $services = MediaWikiServices::getInstance();
-
-               $erGroup = $services->getEventRelayerGroup();
-               if ( isset( $params['channels'] ) ) {
-                       foreach ( $params['channels'] as $action => $channel ) {
-                               $params['relayers'][$action] = $erGroup->getRelayer( $channel );
-                               $params['channels'][$action] = $channel;
-                       }
-               }
                $params['cache'] = self::newFromParams( $params['store'] );
                $params['logger'] = LoggerFactory::getInstance( $params['loggroup'] ?? 'objectcache' );
                if ( !$wgCommandLineMode ) {
@@ -409,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';
                }