From 99cf057e0f073ccb7249f9372ed5fcc649c77cfa Mon Sep 17 00:00:00 2001 From: Derick Alangi Date: Thu, 18 Jul 2019 09:22:01 +0100 Subject: [PATCH] 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 --- includes/GlobalFunctions.php | 1 + tests/phpunit/includes/GlobalFunctions/GlobalTest.php | 1 + 2 files changed, 2 insertions(+) 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' ) -- 2.20.1