Deprecate wfGetCache() and wfGetMainCache()
authorKunal Mehta <legoktm@member.fsf.org>
Tue, 14 Aug 2018 23:43:25 +0000 (16:43 -0700)
committerKrinkle <krinklemail@gmail.com>
Fri, 17 Aug 2018 17:56:21 +0000 (17:56 +0000)
The former is already a wrapper around ObjectCache::getInstance().

The latter was identical to ObjectCache::getLocalClusterInstance().

Bug: T115890
Change-Id: Ib4e43bc8d3f4ac9f7a453e36dcce9b3d962666ba

RELEASE-NOTES-1.32
includes/GlobalFunctions.php
includes/Setup.php

index f71ebc0..990cc1f 100644 (file)
@@ -348,6 +348,9 @@ because of Phabricator reports.
 * $wgContLang is deprecated, use MediaWikiServices::getContentLanguage()
   instead.
 * $wgParser is deprecated, use MediaWikiServices::getParser() instead.
+* wfGetMainCache() is deprecated, use ObjectCache::getLocalClusterInstance()
+  instead.
+* wfGetCache() is deprecated, use ObjectCache::getInstance() instead.
 
 === Other changes in 1.32 ===
 * (T198811) The following tables have had their UNIQUE indexes turned into
index 567db85..d24b74d 100644 (file)
@@ -3119,6 +3119,7 @@ function wfBCP47( $code ) {
 /**
  * Get a specific cache object.
  *
+ * @deprecated since 1.32, use ObjectCache::getInstance() instead
  * @param int|string $cacheType A CACHE_* constants, or other key in $wgObjectCaches
  * @return BagOStuff
  */
@@ -3129,11 +3130,11 @@ function wfGetCache( $cacheType ) {
 /**
  * Get the main cache object
  *
+ * @deprecated since 1.32, use ObjectCache::getLocalClusterInstance() instead
  * @return BagOStuff
  */
 function wfGetMainCache() {
-       global $wgMainCacheType;
-       return ObjectCache::getInstance( $wgMainCacheType );
+       return ObjectCache::getLocalClusterInstance();
 }
 
 /**
index f8650fd..c015eac 100644 (file)
@@ -774,7 +774,7 @@ if ( $wgCommandLineMode ) {
        wfDebug( $debug );
 }
 
-$wgMemc = wfGetMainCache();
+$wgMemc = ObjectCache::getLocalClusterInstance();
 $messageMemc = wfGetMessageCacheStorage();
 
 wfDebugLog( 'caches',