From: Aaron Schulz Date: Mon, 27 Apr 2015 21:23:32 +0000 (-0700) Subject: Added ObjectCache::getMainWANInstance() helper method X-Git-Tag: 1.31.0-rc.0~11577 X-Git-Url: http://git.cyclocoop.org/%24dirpuce/puce%24spip_lang_rtl.gif?a=commitdiff_plain;h=1f48d8e1930e0109031d1752eac85b597e897a6f;p=lhc%2Fweb%2Fwiklou.git Added ObjectCache::getMainWANInstance() helper method Change-Id: I3d8d93b3bb6f7e06fae7adc694e6d4d851b2d8c2 --- 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 ); + } }