. * * @file * @ingroup extensions */ namespace Popups\EventLogging; use Config; use ExtensionRegistry; class MWEventLogger implements EventLogger { /** * @var Config */ private $config; /** * @var ExtensionRegistry */ private $registry; /** * Module constructor. * @param Config $config MediaWiki configuration * @param ExtensionRegistry $registry MediaWiki extension registry */ public function __construct( Config $config, ExtensionRegistry $registry ) { $this->config = $config; $this->registry = $registry; } /** * Log event * * @param array $event An associative array containing event data */ public function log( array $event ) { $eventLoggingSchemas = $this->registry->getAttribute( 'EventLoggingSchemas' ); \EventLogging::logEvent( self::PREVIEWS_SCHEMA_NAME, $eventLoggingSchemas[ self::PREVIEWS_SCHEMA_NAME ], $event ); } }