use MediaWiki\MediaWikiServices;
return [
- 'DBLoadBalancerFactory' => function( MediaWikiServices $services ) {
- // NOTE: Defining the LBFactory class via LBFactoryConf is supported for
- // backwards compatibility. The preferred way would be to register a
- // callback for DBLoadBalancerFactory that constructs the desired LBFactory
- // directly.
- $config = $services->getMainConfig()->get( 'LBFactoryConf' );
-
- $class = LBFactory::getLBFactoryClass( $config );
- if ( !isset( $config['readOnlyReason'] ) ) {
- // TODO: replace the global wfConfiguredReadOnlyReason() with a service.
- $config['readOnlyReason'] = wfConfiguredReadOnlyReason();
- }
-
- return new $class( $config );
- },
-
- 'DBLoadBalancer' => function( MediaWikiServices $services ) {
- // just return the default LB from the DBLoadBalancerFactory service
- return $services->getDBLoadBalancerFactory()->getMainLB();
- },
-
'SiteStore' => function( MediaWikiServices $services ) {
- $rawSiteStore = new DBSiteStore( $services->getDBLoadBalancer() );
+ $loadBalancer = wfGetLB(); // TODO: use LB from MediaWikiServices
+ $rawSiteStore = new DBSiteStore( $loadBalancer );
// TODO: replace wfGetCache with a CacheFactory service.
// TODO: replace wfIsHHVM with a capabilities service.
return $services->getConfigFactory()->makeConfig( 'main' );
},
+ 'StatsdDataFactory' => function( MediaWikiServices $services ) {
+ return new BufferingStatsdDataFactory(
+ rtrim( $services->getMainConfig()->get( 'StatsdMetricPrefix' ), '.' )
+ );
+ },
+
+ 'EventRelayerGroup' => function( MediaWikiServices $services ) {
+ return new EventRelayerGroup( $services->getMainConfig()->get( 'EventRelayerConfig' ) );
+ },
+
///////////////////////////////////////////////////////////////////////////
// NOTE: When adding a service here, don't forget to add a getter function
// in the MediaWikiServices class. The convenience getter should just call