From fba157c7734a727ac925a3d9a5c1407d481eb55d Mon Sep 17 00:00:00 2001 From: Alexander Vorwerk Date: Tue, 7 Dec 2021 21:51:49 +0100 Subject: [PATCH] Hard deprecate wfGetCache() and wfGetMainCache() Bug: T293928 Change-Id: I7d9220730cb1f09d5b22f271fb172bd4640212ad --- RELEASE-NOTES-1.38 | 2 ++ includes/GlobalFunctions.php | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES-1.38 b/RELEASE-NOTES-1.38 index 2d0ff2e0310..4ce5a3a5ae1 100644 --- a/RELEASE-NOTES-1.38 +++ b/RELEASE-NOTES-1.38 @@ -404,6 +404,8 @@ because of Phabricator reports. - Use ArchivedRevisionLookup::hasArchivedRevisions instead of ::isDeleted. * The `mediawiki.pager.tablePager` module was deprecated in favor of the more generic `mediawiki.pager.styles`. +* wfGetCache() and wfGetMainCache(), both deprecated since 1.32, now emit + deprecation warnings. * LinkCache::addGoodLinkObj() has been hard deprecated. * ApiStashEdit::parseAndStash has been hard deprecated. * Content::prepareSave was hard-deprecated, now emits deprecation warnings. diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 0a6ddc9733b..f3be87e55cd 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2428,21 +2428,27 @@ function wfShorthandToInteger( $string = '', $default = -1 ) { /** * Get a specific cache object. * - * @deprecated since 1.32, use ObjectCache::getInstance() instead + * @deprecated since 1.32, hard deprecated since 1.38 + * Use ObjectCache::getInstance() instead + * * @param int|string $cacheType A CACHE_* constants, or other key in $wgObjectCaches * @return BagOStuff */ function wfGetCache( $cacheType ) { + wfDeprecated( __FUNCTION__, '1.32' ); return ObjectCache::getInstance( $cacheType ); } /** * Get the main cache object * - * @deprecated since 1.32, use ObjectCache::getLocalClusterInstance() instead + * @deprecated since 1.32, hard deprecated since 1.38 + * Use ObjectCache::getLocalClusterInstance() instead + * * @return BagOStuff */ function wfGetMainCache() { + wfDeprecated( __FUNCTION__, '1.32' ); return ObjectCache::getLocalClusterInstance(); }