2020-05-12 18:22:37 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use MediaWiki\Config\ServiceOptions;
|
|
|
|
use MediaWiki\Extension\Math\InputCheck\InputCheckFactory;
|
2021-08-11 18:15:35 +00:00
|
|
|
use MediaWiki\Extension\Math\MathConfig;
|
2022-07-20 18:14:11 +00:00
|
|
|
use MediaWiki\Extension\Math\MathWikibaseConfig;
|
|
|
|
use MediaWiki\Extension\Math\MathWikibaseConnector;
|
2021-07-30 19:17:20 +00:00
|
|
|
use MediaWiki\Extension\Math\Render\RendererFactory;
|
2020-05-12 18:22:37 +00:00
|
|
|
use MediaWiki\Logger\LoggerFactory;
|
|
|
|
use MediaWiki\MediaWikiServices;
|
2022-07-21 08:02:56 +00:00
|
|
|
use Wikibase\Client\WikibaseClient;
|
2020-05-12 18:22:37 +00:00
|
|
|
|
|
|
|
return [
|
2021-05-04 08:06:42 +00:00
|
|
|
'Math.CheckerFactory' => static function ( MediaWikiServices $services ): InputCheckFactory {
|
2020-05-12 18:22:37 +00:00
|
|
|
return new InputCheckFactory(
|
|
|
|
new ServiceOptions(
|
|
|
|
InputCheckFactory::CONSTRUCTOR_OPTIONS,
|
|
|
|
$services->getMainConfig()
|
|
|
|
),
|
|
|
|
$services->getMainWANObjectCache(),
|
|
|
|
$services->getHttpRequestFactory(),
|
|
|
|
LoggerFactory::getInstance( 'Math' )
|
|
|
|
);
|
|
|
|
},
|
2021-08-11 18:15:35 +00:00
|
|
|
'Math.Config' => static function ( MediaWikiServices $services ): MathConfig {
|
|
|
|
return new MathConfig(
|
|
|
|
new ServiceOptions( MathConfig::CONSTRUCTOR_OPTIONS, $services->getMainConfig() )
|
|
|
|
);
|
|
|
|
},
|
2021-07-30 19:17:20 +00:00
|
|
|
'Math.RendererFactory' => static function ( MediaWikiServices $services ): RendererFactory {
|
|
|
|
return new RendererFactory(
|
|
|
|
new ServiceOptions(
|
|
|
|
RendererFactory::CONSTRUCTOR_OPTIONS,
|
|
|
|
$services->getMainConfig()
|
|
|
|
),
|
2021-08-11 18:15:35 +00:00
|
|
|
$services->get( 'Math.Config' ),
|
2021-07-30 19:17:20 +00:00
|
|
|
$services->getUserOptionsLookup(),
|
|
|
|
LoggerFactory::getInstance( 'Math' )
|
|
|
|
);
|
|
|
|
},
|
2022-07-20 18:14:11 +00:00
|
|
|
'Math.WikibaseConnector' => static function ( MediaWikiServices $services ): MathWikibaseConnector {
|
|
|
|
return new MathWikibaseConnector(
|
2022-07-21 08:02:56 +00:00
|
|
|
$services->get( 'Math.WikibaseConfig' ),
|
|
|
|
WikibaseClient::getRepoLinker( $services ),
|
|
|
|
$services->getLanguageFactory(),
|
2022-07-20 18:14:11 +00:00
|
|
|
LoggerFactory::getInstance( 'Math' )
|
|
|
|
);
|
|
|
|
},
|
2022-07-21 08:02:56 +00:00
|
|
|
'Math.WikibaseConfig' => static function ( MediaWikiServices $services ): MathWikibaseConfig {
|
|
|
|
return new MathWikibaseConfig(
|
|
|
|
WikibaseClient::getEntityIdParser( $services ),
|
|
|
|
WikibaseClient::getEntityRevisionLookup( $services ),
|
|
|
|
WikibaseClient::getFallbackLabelDescriptionLookupFactory( $services ),
|
|
|
|
WikibaseClient::getSite( $services ),
|
|
|
|
$services->getMainConfig()
|
|
|
|
);
|
|
|
|
},
|
2020-05-12 18:22:37 +00:00
|
|
|
];
|