From 72734cfffafa797cbcb5eea9f416f47d6e842e92 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 20 Oct 2015 23:52:07 -0700 Subject: [PATCH] Replace some calls to wfGetMainCache() Change-Id: I9ba8fd5918877af6312b0854634bd36211438f00 --- includes/db/loadbalancer/LoadMonitorMySQL.php | 2 +- includes/filebackend/SwiftFileBackend.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/db/loadbalancer/LoadMonitorMySQL.php b/includes/db/loadbalancer/LoadMonitorMySQL.php index 39ced1be88..f49e965e91 100644 --- a/includes/db/loadbalancer/LoadMonitorMySQL.php +++ b/includes/db/loadbalancer/LoadMonitorMySQL.php @@ -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 ) { diff --git a/includes/filebackend/SwiftFileBackend.php b/includes/filebackend/SwiftFileBackend.php index 408194f49e..e72d026205 100644 --- a/includes/filebackend/SwiftFileBackend.php +++ b/includes/filebackend/SwiftFileBackend.php @@ -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 { -- 2.20.1