2020-05-12 18:22:37 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use MediaWiki\Config\ServiceOptions;
|
|
|
|
use MediaWiki\Extension\Math\InputCheck\InputCheckFactory;
|
2022-07-21 15:47:52 +00:00
|
|
|
use MediaWiki\Extension\Math\Math;
|
2021-08-11 18:15:35 +00:00
|
|
|
use MediaWiki\Extension\Math\MathConfig;
|
2022-07-08 05:13:08 +00:00
|
|
|
use MediaWiki\Extension\Math\MathFormatter;
|
2022-07-20 18:14:11 +00:00
|
|
|
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;
|
2022-07-08 05:13:08 +00:00
|
|
|
use Wikibase\Lib\Formatters\SnakFormatter;
|
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(
|
2022-07-17 09:59:09 +00:00
|
|
|
new ServiceOptions( MathConfig::CONSTRUCTOR_OPTIONS, $services->getMainConfig() ),
|
|
|
|
ExtensionRegistry::getInstance()
|
2021-08-11 18:15:35 +00:00
|
|
|
);
|
|
|
|
},
|
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()
|
|
|
|
),
|
2022-07-21 15:47:52 +00:00
|
|
|
Math::getMathConfig( $services ),
|
2021-07-30 19:17:20 +00:00
|
|
|
$services->getUserOptionsLookup(),
|
2023-11-19 19:23:09 +00:00
|
|
|
LoggerFactory::getInstance( 'Math' ),
|
|
|
|
$services->getMainWANObjectCache()
|
2021-07-30 19:17:20 +00:00
|
|
|
);
|
|
|
|
},
|
2022-07-20 18:14:11 +00:00
|
|
|
'Math.WikibaseConnector' => static function ( MediaWikiServices $services ): MathWikibaseConnector {
|
|
|
|
return new MathWikibaseConnector(
|
2022-07-23 09:33:40 +00:00
|
|
|
new ServiceOptions( MathWikibaseConnector::CONSTRUCTOR_OPTIONS, $services->getMainConfig() ),
|
2022-07-21 08:02:56 +00:00
|
|
|
WikibaseClient::getRepoLinker( $services ),
|
|
|
|
$services->getLanguageFactory(),
|
2022-11-18 19:26:02 +00:00
|
|
|
$services->getLanguageNameUtils(),
|
2022-07-21 08:02:56 +00:00
|
|
|
WikibaseClient::getEntityRevisionLookup( $services ),
|
|
|
|
WikibaseClient::getFallbackLabelDescriptionLookupFactory( $services ),
|
|
|
|
WikibaseClient::getSite( $services ),
|
2022-07-23 09:33:40 +00:00
|
|
|
WikibaseClient::getEntityIdParser( $services ),
|
2022-07-08 05:13:08 +00:00
|
|
|
new MathFormatter( SnakFormatter::FORMAT_HTML ),
|
2022-07-23 09:33:40 +00:00
|
|
|
LoggerFactory::getInstance( 'Math' )
|
2022-07-21 08:02:56 +00:00
|
|
|
);
|
2022-07-23 09:33:40 +00:00
|
|
|
}
|
2020-05-12 18:22:37 +00:00
|
|
|
];
|