Replace some calls to wfGetMainCache()
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 21 Oct 2015 06:52:07 +0000 (23:52 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 21 Oct 2015 06:52:07 +0000 (23:52 -0700)
Change-Id: I9ba8fd5918877af6312b0854634bd36211438f00

includes/db/loadbalancer/LoadMonitorMySQL.php
includes/filebackend/SwiftFileBackend.php

index 39ced1b..f49e965 100644 (file)
@@ -37,7 +37,7 @@ class LoadMonitorMySQL implements LoadMonitor {
                $this->parent = $parent;
 
                $this->srvCache = ObjectCache::newAccelerator( 'hash' );
-               $this->mainCache = wfGetMainCache();
+               $this->mainCache = ObjectCache::getLocalClusterInstance();
        }
 
        public function scaleLoads( &$loads, $group = false, $wiki = false ) {
index 408194f..e72d026 100644 (file)
@@ -136,9 +136,10 @@ class SwiftFileBackend extends FileBackendStore {
                // Cache auth token information to avoid RTTs
                if ( !empty( $config['cacheAuthInfo'] ) ) {
                        if ( PHP_SAPI === 'cli' ) {
-                               $this->srvCache = wfGetMainCache(); // preferrably memcached
+                               // Preferrably memcached
+                               $this->srvCache = ObjectCache::getLocalClusterInstance();
                        } else {
-                               // look for APC, XCache, WinCache, ect...
+                               // Look for APC, XCache, WinCache, ect...
                                $this->srvCache = ObjectCache::newAccelerator( CACHE_NONE );
                        }
                } else {