Hooks class.
Used to supersede $wgHooks, because globals are EVIL.
- Since
- 1.18
Definition at line 34 of file Hooks.php.
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.
- Since
- 1.18
- Parameters
-
- Returns
- bool True if the hook has a function registered to it
Definition at line 83 of file Hooks.php.
References $name, $wgHooks, and global.
static Hooks::run |
( |
|
$event, |
|
|
array |
$args = [] , |
|
|
|
$deprecatedVersion = null |
|
) |
| |
|
static |
Call hook functions defined in Hooks::register and $wgHooks.
For a certain hook event, fetch the array of hook events and process them. Determine the proper callback for each hook and then call the actual hook using the appropriate arguments. Finally, process the return value and return/throw accordingly.
- Parameters
-
string | $event | Event name |
array | $args | Array of parameters passed to hook functions |
string | null | $deprecatedVersion | Optionally, mark hook as deprecated with version number |
- Returns
- bool True if no handler aborted the hook
- Exceptions
-
- Since
- 1.22 A hook function is not required to return a value for processing to continue. Not returning a value (or explicitly returning null) is equivalent to returning true.
Definition at line 131 of file Hooks.php.
References $args, $retval, as, and wfDeprecated().
Referenced by SpecialPageFactory\executePath(), MediaWiki\Interwiki\ClassicInterwikiLookup\load(), and SpecialMIMESearchTest\testMimeFiltering().