mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SpamBlacklist
synced 2024-11-27 16:40:04 +00:00
Use ObjectCacheFactory instead of deprecated ObjectCache methods
Bug: T363770 Change-Id: I235642d059855a8c5f7296095965687ae73c6efb
This commit is contained in:
parent
40a66cf54f
commit
b93b997de5
|
@ -7,7 +7,6 @@ use MediaWiki\MediaWikiServices;
|
|||
use MediaWiki\Revision\SlotRecord;
|
||||
use MediaWiki\Title\Title;
|
||||
use MediaWiki\User\User;
|
||||
use ObjectCache;
|
||||
use TextContent;
|
||||
|
||||
/**
|
||||
|
@ -374,7 +373,8 @@ abstract class BaseBlacklist {
|
|||
// 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()->getObjectCacheFactory();
|
||||
$cache = $services->getInstance( $wgMessageCacheType );
|
||||
|
||||
$listType = $this->getBlacklistType();
|
||||
// There are two keys, when the warning key expires, a random thread will refresh
|
||||
|
|
|
@ -10,7 +10,6 @@ use MediaWiki\ExternalLinks\ExternalLinksLookup;
|
|||
use MediaWiki\MediaWikiServices;
|
||||
use MediaWiki\Title\Title;
|
||||
use MediaWiki\User\User;
|
||||
use ObjectCache;
|
||||
use RequestContext;
|
||||
use Wikimedia\AtEase\AtEase;
|
||||
use Wikimedia\Rdbms\Database;
|
||||
|
@ -62,8 +61,9 @@ class SpamBlacklist extends BaseBlacklist {
|
|||
$preventLog = false,
|
||||
$mode = 'check'
|
||||
) {
|
||||
$statsd = MediaWikiServices::getInstance()->getStatsdDataFactory();
|
||||
$cache = ObjectCache::getLocalClusterInstance();
|
||||
$services = MediaWikiServices::getInstance();
|
||||
$statsd = $services->getStatsdDataFactory();
|
||||
$cache = $services->getObjectCacheFactory()->getLocalClusterInstance();
|
||||
|
||||
if ( !$links ) {
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue