Use ObjectCacheFactory instead of deprecated ObjectCache method

Bug: T363770
Change-Id: I2f59251914902dccef1bf7aac2d0c1008ebd21e2
This commit is contained in:
Wandji69 2024-05-21 01:26:38 +01:00 committed by Krinkle
parent 26e918586b
commit 11ba95998f

View file

@ -13,7 +13,6 @@ use BadMethodCallException;
use MediaWiki\MediaWikiServices;
use MediaWiki\Title\Title;
use MediaWiki\User\User;
use ObjectCache;
use TextContent;
use Wikimedia\AtEase\AtEase;
@ -297,7 +296,8 @@ class TitleBlacklist {
// FIXME: This is a hack to use Memcached where possible (incl. WMF),
// but have CACHE_DB as fallback (instead of no cache).
// This might be a good candidate for T248005.
$cache = ObjectCache::getInstance( $wgMessageCacheType );
$services = MediaWikiServices::getInstance();
$cache = $services->getObjectCacheFactory()->getInstance( $wgMessageCacheType );
// Globally shared
$key = $cache->makeGlobalKey( 'title_blacklist_source', md5( $url ) );