From: Derick Alangi Date: Thu, 18 Jul 2019 08:22:01 +0000 (+0100) Subject: GlobalFunctions: Hard deprecate `wfGlobalCacheKey()` function X-Git-Tag: 1.34.0-rc.0~955^2 X-Git-Url: http://git.cyclocoop.org/data/File:Image2.gif?a=commitdiff_plain;h=99cf057e0f073ccb7249f9372ed5fcc649c77cfa;p=lhc%2Fweb%2Fwiklou.git GlobalFunctions: Hard deprecate `wfGlobalCacheKey()` function The only extension that used this was ConfirmEdit and it has been cleaned up with Ia7b276ee65fdf58c, so is it time we hard deprecate it? Usage ===== https://codesearch.wmflabs.org/search/?q=%5CbwfGlobalCacheKey%5Cb&i=nope&files=&repos= Depends-On: Ia7b276ee65fdf58c4fc0859563930528d44a03ca Change-Id: I3fda797c64ec62df4454625ad1a3bf89f6a88246 --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index c6c386c42f..7b4b502905 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2521,6 +2521,7 @@ function wfForeignMemcKey( $db, $prefix, ...$args ) { * @return string */ function wfGlobalCacheKey( ...$args ) { + wfDeprecated( __METHOD__, '1.30' ); return ObjectCache::getLocalClusterInstance()->makeGlobalKey( ...$args ); } diff --git a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php index 1210a507db..660734e7c4 100644 --- a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php +++ b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php @@ -716,6 +716,7 @@ class GlobalTest extends MediaWikiTestCase { */ public function testWfGlobalCacheKey() { $cache = ObjectCache::getLocalClusterInstance(); + $this->hideDeprecated( 'wfGlobalCacheKey' ); $this->assertEquals( $cache->makeGlobalKey( 'foo', 123, 'bar' ), wfGlobalCacheKey( 'foo', 123, 'bar' )