Handbuch:$wgHooks

This page is a translated version of the page Manual:$wgHooks and the translation is 67% complete.
Erweiterungen: $wgHooks
Globale Liste von Hooks.
Eingeführt in Version:1.4.0 (r6405)
Entfernt in Version:Weiterhin vorhanden
Erlaubte Werte:Siehe Details
Standardwert:[]

Details

Globale Liste von Hooks. It is an array of arrays: it specifies for every event an array of functions to be called.

In MW 1.40, the use of $wgHooks after initialisation was deprecated (T331602). Verwende stattdessen HookContainer::register und HookContainer::scopedRegister .

Add a hook by doing:

$wgHooks['event_name'][] = 'function';

oder:

$wgHooks['event_name'][] = array( 'function', $data );

oder:

$wgHooks['event_name'][] = array( $object, 'method' );

oder:

$wgHooks['event_name'][] = $object;

In the last case, the callback is expected to be a method in $object of the same name as the event preceded by "on", e.g. "onUnknownAction"

Hooks are called when events happen, where a hook is a PHP function, and an event is an abstract concept.


Siehe auch