比较提交

...

2 次代码提交

作者 SHA1 备注 提交日期
jenkins-bot
d11667f6dd Merge "Use ObjectCacheFactory instead of deprecated ObjectCache method" 2024-05-15 17:50:18 +00:00
Wandji69
0efc5a5c70 Use ObjectCacheFactory instead of deprecated ObjectCache method
Bug: T363770
Change-Id: Iace87e3b3d1a7e269bafeaa3bdffc51361ee197d
2024-05-15 12:19:05 +00:00

查看文件

@ -24,10 +24,10 @@ use BagOStuff;
use CachedBagOStuff;
use IBufferingStatsdDataFactory;
use MediaWiki\Config\ServiceOptions;
use MediaWiki\MediaWikiServices;
use MediaWiki\Session\Session;
use MediaWiki\Session\SessionManager;
use MWCryptRand;
use ObjectCache;
use Wikimedia\Stats\StatsFactory;
class CentralAuthSessionManager {
@ -102,7 +102,7 @@ class CentralAuthSessionManager {
if ( !$this->sessionStore ) {
$sessionCacheType = $this->options->get( 'CentralAuthSessionCacheType' )
?? $this->options->get( 'SessionCacheType' );
$cache = ObjectCache::getInstance( $sessionCacheType );
$cache = MediaWikiServices::getInstance()->getObjectCacheFactory()->getInstance( $sessionCacheType );
$this->sessionStore = $cache instanceof CachedBagOStuff
? $cache : new CachedBagOStuff( $cache );
}