. * * @file * @ingroup extensions */ namespace Popups\EventLogging; use Config; use ExtensionRegistry; class EventLoggerFactory { /** * @var ExtensionRegistry */ private $registry; /** * @var Config */ private $config; /** * EventLoggerFactory constructor * * @param Config $config MediaWiki config * @param ExtensionRegistry $registry MediaWiki extension registry */ public function __construct( Config $config, ExtensionRegistry $registry ) { $this->registry = $registry; $this->config = $config; } /** * Get the EventLogger instance * * @return EventLogger */ public function get() { if ( $this->registry->isLoaded( 'EventLogging' ) ) { return new MWEventLogger( $this->config, $this->registry ); } return new NullLogger(); } }