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