From 1f48d8e1930e0109031d1752eac85b597e897a6f Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 27 Apr 2015 14:23:32 -0700 Subject: [PATCH] Added ObjectCache::getMainWANInstance() helper method Change-Id: I3d8d93b3bb6f7e06fae7adc694e6d4d851b2d8c2 --- includes/objectcache/ObjectCache.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/includes/objectcache/ObjectCache.php b/includes/objectcache/ObjectCache.php index 301336f69c..5da22f0fd2 100644 --- a/includes/objectcache/ObjectCache.php +++ b/includes/objectcache/ObjectCache.php @@ -57,6 +57,7 @@ class ObjectCache { * @param string $id * * @return WANObjectCache + * @since 1.26 */ static function getWANInstance( $id ) { if ( isset( self::$wanInstances[$id] ) ) { @@ -196,6 +197,7 @@ class ObjectCache { * * @throws MWException * @return WANObjectCache + * @since 1.26 */ static function newWANCacheFromId( $id ) { global $wgWANObjectCaches; @@ -213,4 +215,16 @@ class ObjectCache { return new $class( $params ); } + + /** + * Get the main WAN cache object + * + * @return WANObjectCache + * @since 1.26 + */ + static function getMainWANInstance() { + global $wgMainWANCache; + + return self::getWANInstance( $wgMainWANCache ); + } } -- 2.20.1