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\Revision\SlotRecord;
|
||||||
use MediaWiki\Title\Title;
|
use MediaWiki\Title\Title;
|
||||||
use MediaWiki\User\User;
|
use MediaWiki\User\User;
|
||||||
use ObjectCache;
|
|
||||||
use TextContent;
|
use TextContent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -374,7 +373,8 @@ abstract class BaseBlacklist {
|
||||||
// FIXME: This is a hack to use Memcached where possible (incl. WMF),
|
// FIXME: This is a hack to use Memcached where possible (incl. WMF),
|
||||||
// but have CACHE_DB as fallback (instead of no cache).
|
// but have CACHE_DB as fallback (instead of no cache).
|
||||||
// This might be a good candidate for T248005.
|
// This might be a good candidate for T248005.
|
||||||
$cache = ObjectCache::getInstance( $wgMessageCacheType );
|
$services = MediaWikiServices::getInstance()->getObjectCacheFactory();
|
||||||
|
$cache = $services->getInstance( $wgMessageCacheType );
|
||||||
|
|
||||||
$listType = $this->getBlacklistType();
|
$listType = $this->getBlacklistType();
|
||||||
// There are two keys, when the warning key expires, a random thread will refresh
|
// 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\MediaWikiServices;
|
||||||
use MediaWiki\Title\Title;
|
use MediaWiki\Title\Title;
|
||||||
use MediaWiki\User\User;
|
use MediaWiki\User\User;
|
||||||
use ObjectCache;
|
|
||||||
use RequestContext;
|
use RequestContext;
|
||||||
use Wikimedia\AtEase\AtEase;
|
use Wikimedia\AtEase\AtEase;
|
||||||
use Wikimedia\Rdbms\Database;
|
use Wikimedia\Rdbms\Database;
|
||||||
|
@ -62,8 +61,9 @@ class SpamBlacklist extends BaseBlacklist {
|
||||||
$preventLog = false,
|
$preventLog = false,
|
||||||
$mode = 'check'
|
$mode = 'check'
|
||||||
) {
|
) {
|
||||||
$statsd = MediaWikiServices::getInstance()->getStatsdDataFactory();
|
$services = MediaWikiServices::getInstance();
|
||||||
$cache = ObjectCache::getLocalClusterInstance();
|
$statsd = $services->getStatsdDataFactory();
|
||||||
|
$cache = $services->getObjectCacheFactory()->getLocalClusterInstance();
|
||||||
|
|
||||||
if ( !$links ) {
|
if ( !$links ) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue