2024-09-06 14:25:26 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Cite\ReferencePreviews\ReferencePreviewsContext;
|
2024-09-06 12:21:58 +00:00
|
|
|
use Cite\ReferencePreviews\ReferencePreviewsGadgetsIntegration;
|
2024-09-06 14:25:26 +00:00
|
|
|
use MediaWiki\MediaWikiServices;
|
2024-09-06 12:21:58 +00:00
|
|
|
use MediaWiki\Registration\ExtensionRegistry;
|
2024-09-06 14:25:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @codeCoverageIgnore
|
|
|
|
*/
|
|
|
|
return [
|
2024-09-06 12:21:58 +00:00
|
|
|
'Cite.GadgetsIntegration' => static function ( MediaWikiServices $services ): ReferencePreviewsGadgetsIntegration {
|
|
|
|
return new ReferencePreviewsGadgetsIntegration(
|
|
|
|
$services->getMainConfig(),
|
|
|
|
ExtensionRegistry::getInstance()->isLoaded( 'Gadgets' ) ?
|
|
|
|
$services->getService( 'GadgetsRepo' ) :
|
|
|
|
null
|
|
|
|
);
|
|
|
|
},
|
2024-09-06 14:25:26 +00:00
|
|
|
'Cite.ReferencePreviewsContext' => static function ( MediaWikiServices $services ): ReferencePreviewsContext {
|
|
|
|
return new ReferencePreviewsContext(
|
|
|
|
$services->getMainConfig(),
|
2024-09-06 12:21:58 +00:00
|
|
|
$services->getService( 'Cite.GadgetsIntegration' ),
|
2024-09-06 14:25:26 +00:00
|
|
|
$services->getUserOptionsLookup()
|
|
|
|
);
|
|
|
|
},
|
|
|
|
];
|