From: Kunal Mehta Date: Tue, 14 Aug 2018 23:43:25 +0000 (-0700) Subject: Deprecate wfGetCache() and wfGetMainCache() X-Git-Tag: 1.34.0-rc.0~4397^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=49efdca8f5fbca737b81032ca6595730aed4bbfd;p=lhc%2Fweb%2Fwiklou.git Deprecate wfGetCache() and wfGetMainCache() The former is already a wrapper around ObjectCache::getInstance(). The latter was identical to ObjectCache::getLocalClusterInstance(). Bug: T115890 Change-Id: Ib4e43bc8d3f4ac9f7a453e36dcce9b3d962666ba --- diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index f71ebc0746..990cc1f95c 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -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 diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 567db853ee..d24b74d719 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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(); } /** diff --git a/includes/Setup.php b/includes/Setup.php index f8650fd837..c015eacd5c 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -774,7 +774,7 @@ if ( $wgCommandLineMode ) { wfDebug( $debug ); } -$wgMemc = wfGetMainCache(); +$wgMemc = ObjectCache::getLocalClusterInstance(); $messageMemc = wfGetMessageCacheStorage(); wfDebugLog( 'caches',