X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fcache%2FGenderCache.php;h=a34d23586ab5351c930f945cebe0bdf29206968d;hb=b1fae297981bf99cb17e424cc640ef75e98175d5;hp=19695dfaf2638d4001b2536b8e92ea9faa593e06;hpb=3071f1fad720f1773864621158a0c59b73124896;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/cache/GenderCache.php b/includes/cache/GenderCache.php index 19695dfaf2..a34d23586a 100644 --- a/includes/cache/GenderCache.php +++ b/includes/cache/GenderCache.php @@ -21,6 +21,7 @@ * @author Niklas Laxström * @ingroup Cache */ +use MediaWiki\MediaWikiServices; /** * Caches user genders when needed to use correct namespace aliases. @@ -34,18 +35,11 @@ class GenderCache { protected $missLimit = 1000; /** + * @deprecated in 1.28 see MediaWikiServices::getInstance()->getGenderCache() * @return GenderCache */ public static function singleton() { - static $that = null; - if ( $that === null ) { - $that = new self(); - } - - return $that; - } - - protected function __construct() { + return MediaWikiServices::getInstance()->getGenderCache(); } /** @@ -163,7 +157,7 @@ class GenderCache { return; } - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $table = [ 'user', 'user_properties' ]; $fields = [ 'user_name', 'up_value' ]; $conds = [ 'user_name' => $usersToCheck ];