mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-27 17:00:37 +00:00
7b7063ed48
Change-Id: I3918af0ae84c9304e64c64f800e28b51e59b1136
40 lines
1.3 KiB
PHP
40 lines
1.3 KiB
PHP
<?php
|
|
|
|
use MediaWiki\Config\Config;
|
|
use MediaWiki\Logger\LoggerFactory;
|
|
use MediaWiki\MediaWikiServices;
|
|
use MediaWiki\Registration\ExtensionRegistry;
|
|
use Popups\PopupsContext;
|
|
use Popups\PopupsGadgetsIntegration;
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
/**
|
|
* @codeCoverageIgnore
|
|
*/
|
|
return [
|
|
'Popups.Config' => static function ( MediaWikiServices $services ): Config {
|
|
return $services->getService( 'ConfigFactory' )
|
|
->makeConfig( PopupsContext::EXTENSION_NAME );
|
|
},
|
|
'Popups.GadgetsIntegration' => static function ( MediaWikiServices $services ): PopupsGadgetsIntegration {
|
|
return new PopupsGadgetsIntegration(
|
|
$services->getService( 'Popups.Config' ),
|
|
ExtensionRegistry::getInstance()->isLoaded( 'Gadgets' ) ?
|
|
$services->getService( 'GadgetsRepo' ) :
|
|
null
|
|
);
|
|
},
|
|
'Popups.Logger' => static function ( MediaWikiServices $services ): LoggerInterface {
|
|
return LoggerFactory::getInstance( PopupsContext::LOGGER_CHANNEL );
|
|
},
|
|
'Popups.Context' => static function ( MediaWikiServices $services ): PopupsContext {
|
|
return new PopupsContext(
|
|
$services->getService( 'Popups.Config' ),
|
|
ExtensionRegistry::getInstance(),
|
|
$services->getService( 'Popups.GadgetsIntegration' ),
|
|
$services->getSpecialPageFactory(),
|
|
$services->getUserOptionsLookup()
|
|
);
|
|
}
|
|
];
|