mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-30 18:35:12 +00:00
1b7a46ff4f
Needed for I869af06896b9757af18488b916211c5a41a8c563, where I am trying to change LanguageFactory in MediaWiki core not to use MWException. I truly feel mocked after working with this code. See if you can find the two lines in this diff where the meaningful changes are. Change-Id: Ifcb31dbb7113ce57526f06558cde2abedee317d7
59 lines
2.1 KiB
PHP
59 lines
2.1 KiB
PHP
<?php
|
|
|
|
use MediaWiki\Config\ServiceOptions;
|
|
use MediaWiki\Extension\Math\InputCheck\InputCheckFactory;
|
|
use MediaWiki\Extension\Math\Math;
|
|
use MediaWiki\Extension\Math\MathConfig;
|
|
use MediaWiki\Extension\Math\MathFormatter;
|
|
use MediaWiki\Extension\Math\MathWikibaseConnector;
|
|
use MediaWiki\Extension\Math\Render\RendererFactory;
|
|
use MediaWiki\Logger\LoggerFactory;
|
|
use MediaWiki\MediaWikiServices;
|
|
use Wikibase\Client\WikibaseClient;
|
|
use Wikibase\Lib\Formatters\SnakFormatter;
|
|
|
|
return [
|
|
'Math.CheckerFactory' => static function ( MediaWikiServices $services ): InputCheckFactory {
|
|
return new InputCheckFactory(
|
|
new ServiceOptions(
|
|
InputCheckFactory::CONSTRUCTOR_OPTIONS,
|
|
$services->getMainConfig()
|
|
),
|
|
$services->getMainWANObjectCache(),
|
|
$services->getHttpRequestFactory(),
|
|
LoggerFactory::getInstance( 'Math' )
|
|
);
|
|
},
|
|
'Math.Config' => static function ( MediaWikiServices $services ): MathConfig {
|
|
return new MathConfig(
|
|
new ServiceOptions( MathConfig::CONSTRUCTOR_OPTIONS, $services->getMainConfig() ),
|
|
ExtensionRegistry::getInstance()
|
|
);
|
|
},
|
|
'Math.RendererFactory' => static function ( MediaWikiServices $services ): RendererFactory {
|
|
return new RendererFactory(
|
|
new ServiceOptions(
|
|
RendererFactory::CONSTRUCTOR_OPTIONS,
|
|
$services->getMainConfig()
|
|
),
|
|
Math::getMathConfig( $services ),
|
|
$services->getUserOptionsLookup(),
|
|
LoggerFactory::getInstance( 'Math' )
|
|
);
|
|
},
|
|
'Math.WikibaseConnector' => static function ( MediaWikiServices $services ): MathWikibaseConnector {
|
|
return new MathWikibaseConnector(
|
|
new ServiceOptions( MathWikibaseConnector::CONSTRUCTOR_OPTIONS, $services->getMainConfig() ),
|
|
WikibaseClient::getRepoLinker( $services ),
|
|
$services->getLanguageFactory(),
|
|
$services->getLanguageNameUtils(),
|
|
WikibaseClient::getEntityRevisionLookup( $services ),
|
|
WikibaseClient::getFallbackLabelDescriptionLookupFactory( $services ),
|
|
WikibaseClient::getSite( $services ),
|
|
WikibaseClient::getEntityIdParser( $services ),
|
|
new MathFormatter( SnakFormatter::FORMAT_HTML ),
|
|
LoggerFactory::getInstance( 'Math' )
|
|
);
|
|
}
|
|
];
|