* MediaWiki code base.
*/
+use MediaWiki\Interwiki\ClassicInterwikiLookup;
+use MediaWiki\Linker\LinkRenderer;
+use MediaWiki\Linker\LinkRendererFactory;
use MediaWiki\MediaWikiServices;
return [
return $services->getConfigFactory()->makeConfig( 'main' );
},
+ 'InterwikiLookup' => function( MediaWikiServices $services ) {
+ global $wgContLang; // TODO: manage $wgContLang as a service
+ $config = $services->getMainConfig();
+ return new ClassicInterwikiLookup(
+ $wgContLang,
+ ObjectCache::getMainWANInstance(),
+ $config->get( 'InterwikiExpiry' ),
+ $config->get( 'InterwikiCache' ),
+ $config->get( 'InterwikiScopes' ),
+ $config->get( 'InterwikiFallbackSite' )
+ );
+ },
+
'StatsdDataFactory' => function( MediaWikiServices $services ) {
return new BufferingStatsdDataFactory(
rtrim( $services->getMainConfig()->get( 'StatsdMetricPrefix' ), '.' )
return $store;
},
+ 'LinkCache' => function( MediaWikiServices $services ) {
+ return new LinkCache(
+ $services->getTitleFormatter()
+ );
+ },
+
+ 'LinkRendererFactory' => function( MediaWikiServices $services ) {
+ return new LinkRendererFactory(
+ $services->getTitleFormatter()
+ );
+ },
+
+ 'LinkRenderer' => function( MediaWikiServices $services ) {
+ global $wgUser;
+
+ return $services->getLinkRendererFactory()->createForUser( $wgUser );
+ },
+
'GenderCache' => function( MediaWikiServices $services ) {
return new GenderCache();
},