2017-07-21 17:06:08 +00:00
|
|
|
<?php
|
|
|
|
|
2019-02-01 08:40:34 +00:00
|
|
|
use MediaWiki\Logger\LoggerFactory;
|
2017-07-21 17:06:08 +00:00
|
|
|
use MediaWiki\MediaWikiServices;
|
2019-02-01 08:40:34 +00:00
|
|
|
use Popups\EventLogging\EventLoggerFactory;
|
2017-07-21 17:06:08 +00:00
|
|
|
use Popups\PopupsContext;
|
|
|
|
use Popups\PopupsGadgetsIntegration;
|
|
|
|
use Popups\UserPreferencesChangeHandler;
|
|
|
|
|
2019-02-01 08:40:34 +00:00
|
|
|
/**
|
|
|
|
* @codeCoverageIgnore
|
|
|
|
*/
|
2017-07-21 17:06:08 +00:00
|
|
|
return [
|
|
|
|
'Popups.Config' => function ( MediaWikiServices $services ) {
|
|
|
|
return $services->getService( 'ConfigFactory' )
|
|
|
|
->makeConfig( PopupsContext::EXTENSION_NAME );
|
|
|
|
},
|
|
|
|
'Popups.GadgetsIntegration' => function ( MediaWikiServices $services ) {
|
|
|
|
return new PopupsGadgetsIntegration(
|
|
|
|
$services->getService( 'Popups.Config' ),
|
|
|
|
ExtensionRegistry::getInstance()
|
|
|
|
);
|
|
|
|
},
|
2019-02-26 22:35:34 +00:00
|
|
|
'Popups.EventLogger' => function ( MediaWikiServices $services ) {
|
2017-07-21 17:06:08 +00:00
|
|
|
$factory = new EventLoggerFactory(
|
|
|
|
ExtensionRegistry::getInstance()
|
|
|
|
);
|
|
|
|
return $factory->get();
|
|
|
|
},
|
|
|
|
'Popups.UserPreferencesChangeHandler' => function ( MediaWikiServices $services ) {
|
|
|
|
return new UserPreferencesChangeHandler(
|
|
|
|
$services->getService( 'Popups.Context' )
|
|
|
|
);
|
|
|
|
},
|
|
|
|
'Popups.Logger' => function ( MediaWikiServices $services ) {
|
|
|
|
return LoggerFactory::getInstance( PopupsContext::LOGGER_CHANNEL );
|
|
|
|
},
|
|
|
|
'Popups.Context' => function ( MediaWikiServices $services ) {
|
|
|
|
return new PopupsContext(
|
|
|
|
$services->getService( 'Popups.Config' ),
|
|
|
|
ExtensionRegistry::getInstance(),
|
|
|
|
$services->getService( 'Popups.GadgetsIntegration' ),
|
|
|
|
$services->getService( 'Popups.EventLogger' )
|
|
|
|
);
|
|
|
|
}
|
|
|
|
];
|