MediaWiki
REL1_21
|
Static Public Member Functions | |
static | clear ($name) |
Clears hooks registered via Hooks::register(). | |
static | getHandlers ($name) |
Returns an array of all the event functions attached to a hook This combines functions registered via Hooks::register and with $wgHooks. | |
static | hookErrorHandler ($errno, $errstr) |
This REALLY should be protected... | |
static | isRegistered ($name) |
Returns true if a hook has a function registered to it. | |
static | register ($name, $callback) |
Attach an event handler to a given hook. | |
static | run ($event, $args=array()) |
Call hook functions defined in Hooks::register. | |
Static Protected Attributes | |
static | $handlers = array() |
static Hooks::clear | ( | $ | name | ) | [static] |
Clears hooks registered via Hooks::register().
Does not touch $wgHooks. This is intended for use while testing and will fail if MW_PHPUNIT_TEST is not defined.
string | $name | the name of the hook to clear. |
MWException | if not in testing mode. |
Definition at line 52 of file Hooks.php.
References $name.
Referenced by PHPUnitMaintClass\finalSetup(), HooksTest\testNewStyleHookInteraction(), and HooksTest\testNewStyleHooks().
static Hooks::getHandlers | ( | $ | name | ) | [static] |
Returns an array of all the event functions attached to a hook This combines functions registered via Hooks::register and with $wgHooks.
MWException | |
FatalError |
string | $name | name of the hook |
Definition at line 102 of file Hooks.php.
References $handlers, $name, $wgHooks, array(), empty, and global.
Referenced by run(), ContentHandler\runLegacyHooks(), and HooksTest\testNewStyleHookInteraction().
static Hooks::hookErrorHandler | ( | $ | errno, |
$ | errstr | ||
) | [static] |
This REALLY should be protected...
but it's public for compatibility
int | $errno | Unused |
string | $errstr | error message |
MWHookException |
static Hooks::isRegistered | ( | $ | name | ) | [static] |
Returns true if a hook has a function registered to it.
The function may have been registered either via Hooks::register or in $wgHooks.
string | $name | name of hook |
Definition at line 85 of file Hooks.php.
References $name, $wgHooks, empty, and global.
Referenced by ContentHandler\runLegacyHooks(), and HooksTest\testNewStyleHookInteraction().
static Hooks::register | ( | $ | name, |
$ | callback | ||
) | [static] |
Attach an event handler to a given hook.
string | $name | name of hook |
$callback | Mixed: callback function to attach |
Definition at line 68 of file Hooks.php.
References $name, and array().
Referenced by PHPUnitMaintClass\finalSetup(), HooksTest\testNewStyleHookInteraction(), HooksTest\testNewStyleHooks(), and ContentHandlerTest\testRunLegacyHooks().
static Hooks::run | ( | $ | event, |
$ | args = array() |
||
) | [static] |
Call hook functions defined in Hooks::register.
string | $event | event name |
$args | Array: parameters passed to hook functions |
MWException | |
FatalError |
Definition at line 144 of file Hooks.php.
References $retval, $wgHooks, array(), as, empty, functions, getHandlers(), global, like, strings, too, wfProfileIn(), and wfProfileOut().
Referenced by wfRunHooks().
Hooks::$handlers = array() [static, protected] |
Definition at line 40 of file Hooks.php.
Referenced by getHandlers().