From: Reedy Date: Thu, 7 Feb 2019 03:30:57 +0000 (+0000) Subject: Stop overwriting $cache in User::getCacheKey() X-Git-Tag: 1.34.0-rc.0~2910^2 X-Git-Url: http://git.cyclocoop.org/data/%7B%7B%20url_for%28%27static%27%2C%20filename=%27js/%40%20%27info_date_publication_anterieure%27%20=%3E%20%27Previously%20published%20on:%27%2C%20%27info_date_referencement%27%20=%3E%20%27THIS%20SITE%20REFERENCED%20ON:%27%2C%20%27info_derniere_etape%27%20=%3E%20%27Done%21%27%2C-%27info_derniers_articles_publies%27%20=%3E%20%27Your%20most%20recently%20published%20articles%27%2C-%27info_desactiver_messagerie_personnelle%27%20=%3E%20%27You%20can%20enable%20or%20disable%20your%20personal%20messaging%20on%20this%20site.%27%2C%20%27info_descriptif%27%20=%3E%20%27Description:%27%2C%20%27info_desinstaller_plugin%27%20=%3E%20%27%20deactivates%20the%20plugin%20and%20deletes%20the%20data%27%2C%20%27info_discussion_cours%27%20=%3E%20%27Current%20discussions%27%2C%40%40%20-332%2C7%20%20284%2C6%20%40%40%20Do%20not%20submit%20this%20import%20request.%3Cp%3EFor%20more%20information%2C%20please%20see%20%3Ca%20href=?a=commitdiff_plain;h=5a1f6dbe6343e76b510537976b17aa8288698aa5;p=lhc%2Fweb%2Fwiklou.git Stop overwriting $cache in User::getCacheKey() Replace a few deprecated function calls Bug: T215483 Change-Id: I000b58d8bf67d9c1ea0123a7547b986e8ca69f25 --- diff --git a/includes/user/User.php b/includes/user/User.php index f23c8ee586..2d97b68da7 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -496,7 +496,6 @@ class User implements IDBAccessObject, UserIdentity { * @return string */ protected function getCacheKey( WANObjectCache $cache ) { - $cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); return $cache->makeGlobalKey( 'user', 'id', $lbFactory->getLocalDomainID(), $this->mId ); @@ -520,7 +519,7 @@ class User implements IDBAccessObject, UserIdentity { * @since 1.25 */ protected function loadFromCache() { - $cache = ObjectCache::getMainWANInstance(); + $cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); $data = $cache->getWithSetCallback( $this->getCacheKey( $cache ), $cache::TTL_HOUR, @@ -2809,7 +2808,7 @@ class User implements IDBAccessObject, UserIdentity { return; } - $cache = ObjectCache::getMainWANInstance(); + $cache = MediaWikiServices::getInstance()->getMainWANObjectCache(); $key = $this->getCacheKey( $cache ); if ( $mode === 'refresh' ) { $cache->delete( $key, 1 );