Merge "Fixed default $wgMainWANCache to trigger Setup.php logic"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 27 Apr 2015 22:15:54 +0000 (22:15 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 27 Apr 2015 22:15:54 +0000 (22:15 +0000)
includes/objectcache/ObjectCache.php

index 301336f..5da22f0 100644 (file)
@@ -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 );
+       }
 }