2017-07-21 17:06:08 +00:00
|
|
|
<?php
|
|
|
|
|
2024-02-01 18:17:39 +00:00
|
|
|
use MediaWiki\Config\Config;
|
2019-02-01 08:40:34 +00:00
|
|
|
use MediaWiki\Logger\LoggerFactory;
|
2017-07-21 17:06:08 +00:00
|
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
use Popups\PopupsContext;
|
|
|
|
use Popups\PopupsGadgetsIntegration;
|
2024-02-01 18:17:39 +00:00
|
|
|
use Psr\Log\LoggerInterface;
|
2017-07-21 17:06:08 +00:00
|
|
|
|
2019-02-01 08:40:34 +00:00
|
|
|
/**
|
|
|
|
* @codeCoverageIgnore
|
|
|
|
*/
|
2017-07-21 17:06:08 +00:00
|
|
|
return [
|
2024-02-01 18:17:39 +00:00
|
|
|
'Popups.Config' => static function ( MediaWikiServices $services ): Config {
|
2017-07-21 17:06:08 +00:00
|
|
|
return $services->getService( 'ConfigFactory' )
|
|
|
|
->makeConfig( PopupsContext::EXTENSION_NAME );
|
|
|
|
},
|
2024-02-01 18:17:39 +00:00
|
|
|
'Popups.GadgetsIntegration' => static function ( MediaWikiServices $services ): PopupsGadgetsIntegration {
|
2017-07-21 17:06:08 +00:00
|
|
|
return new PopupsGadgetsIntegration(
|
|
|
|
$services->getService( 'Popups.Config' ),
|
2024-06-29 19:29:31 +00:00
|
|
|
ExtensionRegistry::getInstance()->isLoaded( 'Gadgets' ) ?
|
|
|
|
$services->getService( 'GadgetsRepo' ) :
|
|
|
|
null
|
2017-07-21 17:06:08 +00:00
|
|
|
);
|
|
|
|
},
|
2024-02-01 18:17:39 +00:00
|
|
|
'Popups.Logger' => static function ( MediaWikiServices $services ): LoggerInterface {
|
2017-07-21 17:06:08 +00:00
|
|
|
return LoggerFactory::getInstance( PopupsContext::LOGGER_CHANNEL );
|
|
|
|
},
|
2024-02-01 18:17:39 +00:00
|
|
|
'Popups.Context' => static function ( MediaWikiServices $services ): PopupsContext {
|
2017-07-21 17:06:08 +00:00
|
|
|
return new PopupsContext(
|
|
|
|
$services->getService( 'Popups.Config' ),
|
|
|
|
ExtensionRegistry::getInstance(),
|
|
|
|
$services->getService( 'Popups.GadgetsIntegration' ),
|
2022-11-05 09:25:26 +00:00
|
|
|
$services->getSpecialPageFactory(),
|
2021-06-06 13:07:08 +00:00
|
|
|
$services->getUserOptionsLookup()
|
2017-07-21 17:06:08 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
];
|