mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-27 09:10:12 +00:00
Use ObjectCacheFactory instead of deprecated ObjectCache method
Bug: T363770 Change-Id: Ib1aaa8fc3e6099bfaf33ec45645f6774addec711
This commit is contained in:
parent
1c257ea377
commit
37cac555b8
|
@ -8,7 +8,6 @@ use MediaWiki\Deferred\DeferredUpdates;
|
|||
use MediaWiki\MediaWikiServices;
|
||||
use MediaWiki\User\CentralId\CentralIdLookup;
|
||||
use MediaWiki\User\User;
|
||||
use ObjectCache;
|
||||
use UnexpectedValueException;
|
||||
|
||||
/**
|
||||
|
@ -51,11 +50,12 @@ class SeenTime {
|
|||
*/
|
||||
private static function cache() {
|
||||
static $wrappedCache = null;
|
||||
$services = MediaWikiServices::getInstance();
|
||||
|
||||
// Use a configurable cache backend (T222851) and wrap it with CachedBagOStuff
|
||||
// for an in-process cache (T144534)
|
||||
if ( $wrappedCache === null ) {
|
||||
$cacheConfig = MediaWikiServices::getInstance()->getMainConfig()->get( 'EchoSeenTimeCacheType' );
|
||||
$cacheConfig = $services->getMainConfig()->get( 'EchoSeenTimeCacheType' );
|
||||
if ( $cacheConfig === null ) {
|
||||
// Hooks::initEchoExtension sets EchoSeenTimeCacheType to $wgMainStash if it's
|
||||
// null, so this can only happen if $wgMainStash is also null
|
||||
|
@ -63,7 +63,7 @@ class SeenTime {
|
|||
'Either $wgEchoSeenTimeCacheType or $wgMainStash must be set'
|
||||
);
|
||||
}
|
||||
return new CachedBagOStuff( ObjectCache::getInstance( $cacheConfig ) );
|
||||
return new CachedBagOStuff( $services->getObjectCacheFactory()->getInstance( $cacheConfig ) );
|
||||
}
|
||||
|
||||
return $wrappedCache;
|
||||
|
|
Loading…
Reference in a new issue