use Config;
use ConfigFactory;
use EventRelayerGroup;
+use GenderCache;
use GlobalVarConfig;
use Hooks;
use LBFactory;
return $this->getService( 'WatchedItemStore' );
}
+ /**
+ * @since 1.28
+ * @return GenderCache
+ */
+ public function getGenderCache() {
+ return $this->getService( 'GenderCache' );
+ }
+
///////////////////////////////////////////////////////////////////////////
// NOTE: When adding a service getter here, don't forget to add a test
// case for it in MediaWikiServicesTest::provideGetters() and in
return $store;
},
+ 'GenderCache' => function( MediaWikiServices $services ) {
+ return new GenderCache();
+ },
+
///////////////////////////////////////////////////////////////////////////
// NOTE: When adding a service here, don't forget to add a getter function
// in the MediaWikiServices class. The convenience getter should just call
* @author Niklas Laxström
* @ingroup Cache
*/
+use MediaWiki\MediaWikiServices;
/**
* Caches user genders when needed to use correct namespace aliases.
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();
}
/**
'DBLoadBalancerFactory' => [ 'DBLoadBalancerFactory', 'LBFactory' ],
'DBLoadBalancer' => [ 'DBLoadBalancer', 'LoadBalancer' ],
'WatchedItemStore' => [ 'WatchedItemStore', WatchedItemStore::class ],
+ 'GenderCache' => [ 'GenderCache', GenderCache::class ],
];
}