use MediaWiki\Block\BlockRestrictionStore;
use MediaWiki\Config\ConfigRepository;
use MediaWiki\Config\ServiceOptions;
+use MediaWiki\Http\HttpRequestFactory;
use MediaWiki\Interwiki\ClassicInterwikiLookup;
use MediaWiki\Interwiki\InterwikiLookup;
use MediaWiki\Linker\LinkRenderer;
return new DateFormatterFactory;
},
- 'DBLoadBalancer' => function ( MediaWikiServices $services ) : Wikimedia\Rdbms\LoadBalancer {
+ 'DBLoadBalancer' => function ( MediaWikiServices $services ) : Wikimedia\Rdbms\ILoadBalancer {
// just return the default LB from the DBLoadBalancerFactory service
return $services->getDBLoadBalancerFactory()->getMainLB();
},
},
'GenderCache' => function ( MediaWikiServices $services ) : GenderCache {
- return new GenderCache();
+ return new GenderCache( $services->getNamespaceInfo() );
},
'HttpRequestFactory' =>
- function ( MediaWikiServices $services ) : \MediaWiki\Http\HttpRequestFactory {
- return new \MediaWiki\Http\HttpRequestFactory();
+ function ( MediaWikiServices $services ) : HttpRequestFactory {
+ return new HttpRequestFactory();
},
'InterwikiLookup' => function ( MediaWikiServices $services ) : InterwikiLookup {
'LinkCache' => function ( MediaWikiServices $services ) : LinkCache {
return new LinkCache(
$services->getTitleFormatter(),
- $services->getMainWANObjectCache()
+ $services->getMainWANObjectCache(),
+ $services->getNamespaceInfo()
);
},
'LinkRendererFactory' => function ( MediaWikiServices $services ) : LinkRendererFactory {
return new LinkRendererFactory(
$services->getTitleFormatter(),
- $services->getLinkCache()
+ $services->getLinkCache(),
+ $services->getNamespaceInfo()
);
},
},
'NamespaceInfo' => function ( MediaWikiServices $services ) : NamespaceInfo {
- return new NamespaceInfo( $services->getMainConfig() );
+ return new NamespaceInfo( new ServiceOptions( NamespaceInfo::$constructorOptions,
+ $services->getMainConfig() ) );
},
'NameTableStoreFactory' => function ( MediaWikiServices $services ) : NameTableStoreFactory {
},
'ParserFactory' => function ( MediaWikiServices $services ) : ParserFactory {
- return new ParserFactory(
+ $options = new ServiceOptions( Parser::$constructorOptions,
+ // 'class' and 'preprocessorClass'
$services->getMainConfig()->get( 'ParserConf' ),
+ // Make sure to have defaults in case someone overrode ParserConf with something silly
+ [ 'class' => Parser::class,
+ 'preprocessorClass' => Parser::getDefaultPreprocessorClass() ],
+ // Plus a buch of actual config options
+ $services->getMainConfig()
+ );
+
+ return new ParserFactory(
+ $options,
$services->getMagicWordFactory(),
$services->getContentLanguage(),
wfUrlProtocols(),
$services->getSpecialPageFactory(),
- $services->getMainConfig(),
$services->getLinkRendererFactory(),
$services->getNamespaceInfo()
);
DefaultPreferencesFactory::$constructorOptions, $services->getMainConfig() ),
$services->getContentLanguage(),
AuthManager::singleton(),
- $services->getLinkRendererFactory()->create()
+ $services->getLinkRendererFactory()->create(),
+ $services->getNamespaceInfo()
);
$factory->setLogger( LoggerFactory::getInstance( 'preferences' ) );
'ProxyLookup' => function ( MediaWikiServices $services ) : ProxyLookup {
$mainConfig = $services->getMainConfig();
return new ProxyLookup(
- $mainConfig->get( 'SquidServers' ),
- $mainConfig->get( 'SquidServersNoPurge' )
+ $mainConfig->get( 'CdnServers' ),
+ $mainConfig->get( 'CdnServersNoPurge' )
);
},
);
},
+ 'RepoGroup' => function ( MediaWikiServices $services ) : RepoGroup {
+ $config = $services->getMainConfig();
+ return new RepoGroup(
+ $config->get( 'LocalFileRepo' ),
+ $config->get( 'ForeignFileRepos' ),
+ $services->getMainWANObjectCache()
+ );
+ },
+
'ResourceLoader' => function ( MediaWikiServices $services ) : ResourceLoader {
// @todo This should not take a Config object, but it's not so easy to remove because it
// exposes it in a getter, which is actually used.
$services->getMainObjectStash(),
new HashBagOStuff( [ 'maxKeys' => 100 ] ),
$services->getReadOnlyMode(),
- $services->getMainConfig()->get( 'UpdateRowsPerQuery' )
+ $services->getMainConfig()->get( 'UpdateRowsPerQuery' ),
+ $services->getNamespaceInfo(),
+ $services->getRevisionLookup()
);
$store->setStatsdDataFactory( $services->getStatsdDataFactory() );