Extension:EventLogging/Hooks/EventLoggingRegisterSchemas

From Linux Web Expert

Revision as of 16:56, 16 August 2020 by imported>SamanthaNguyen (deprecated in 1.32.0, see https://gerrit.wikimedia.org/r/c/mediawiki/extensions/EventLogging/+/441581)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

EventLoggingRegisterSchemas
Available from version ??? (Gerrit change 120957)
Allows extensions to register schema modules by adding keys to an associative array which is passed by reference to each handler. The array maps schema names to numeric revision IDs. By using this hook handler rather than registering modules directly, extensions can have a soft dependency on EventLogging. If EventLogging is not present, the hook simply never fires. To log events for schemas that have been declared in this fashion, use mw#track.
Define function:
public static function onEventLoggingRegisterSchemas( array &$schemas ) { ... }
Attach hook:
$wgHooks['EventLoggingRegisterSchemas'][] = 'MyExtensionHooks::onEventLoggingRegisterSchemas';
Called from:File(s): EventLogging / EventLoggingHooks.php
Function(s): getSchemas

For more information about attaching hooks, see Manual:Hooks .
For examples of other extensions using this hook, see Category:EventLoggingRegisterSchemas extensions.

See also