Update $wgMainStash comments and merge in those from a deprecated ObjectCache method
[lhc/web/wiklou.git] / includes / objectcache / ObjectCache.php
index fed0854..82b760a 100644 (file)
@@ -326,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 ) {
@@ -373,23 +365,12 @@ class ObjectCache {
        /**
         * Get the cache object for the main stash.
         *
-        * Stash objects are BagOStuff instances suitable for storing light
-        * weight data that is not canonically stored elsewhere (such as RDBMS).
-        * Stashes should be configured to propagate changes to all data-centers.
-        *
-        * Callers should be prepared for:
-        *   - a) Writes to be slower in non-"primary" (e.g. HTTP GET/HEAD only) DCs
-        *   - b) Reads to be eventually consistent, e.g. for get()/getMulti()
-        * In general, this means avoiding updates on idempotent HTTP requests and
-        * avoiding an assumption of perfect serializability (or accepting anomalies).
-        * Reads may be eventually consistent or data might rollback as nodes flap.
-        * Callers can use BagOStuff:READ_LATEST to see the latest available data.
-        *
         * @return BagOStuff
         * @since 1.26
         * @deprecated Since 1.28 Use MediaWikiServices::getInstance()->getMainObjectStash()
         */
        public static function getMainStashInstance() {
+               wfDeprecated( __METHOD__, '1.28' );
                return MediaWikiServices::getInstance()->getMainObjectStash();
        }
 
@@ -408,10 +389,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';
                }