Initialize hook class.
phpbb_hook
phpbb_hook
(array $valid_hooks)
-
array
$valid_hooks: array containing the hookable functions/methods
Add new function to the allowed hooks.
void
add_hook
(mixed $definition)
-
mixed
$definition: Declaring function (with __FUNCTION__) or class with array(__CLASS__, __FUNCTION__)
Calling all functions/methods attached to a specified hook.
Called by the function allowing hooks...
bool
call_hook
(mixed $definition)
-
mixed
$definition: Declaring function (with __FUNCTION__) or class with array(__CLASS__, __FUNCTION__)
Check if the called functions/methods returned something.
bool
hook_return
(mixed $definition)
-
mixed
$definition: Declaring function (with __FUNCTION__) or class with array(__CLASS__, __FUNCTION__)
Give actual result from called functions/methods back.
mixed
hook_return_result
(mixed $definition)
-
mixed
$definition: Declaring function (with __FUNCTION__) or class with array(__CLASS__, __FUNCTION__)
Get result from previously called functions/methods for the same hook
mixed
previous_hook_result
(mixed $definition)
-
mixed
$definition: Declaring function (with __FUNCTION__) or class with array(__CLASS__, __FUNCTION__)
Register function/method to be called within hook This function is normally called by the modification/application to attach/register the functions.
void
register
(mixed $definition, mixed $hook, [string $mode = 'normal'])
-
mixed
$definition: Declaring function (with __FUNCTION__) or class with array(__CLASS__, __FUNCTION__)
-
mixed
$hook: The replacement function/method to be called. Passing function name or array with object/class definition
-
string
$mode: Specify the priority/chain mode. 'normal' -> hook gets appended to the chain. 'standalone' -> only the specified hook gets called - later hooks are not able to overwrite this (E_NOTICE is triggered then). 'first' -> hook is called as the first one within the chain. 'last' -> hook is called as the last one within the chain.
Remove function from the allowed hooks.
void
remove_hook
(mixed $definition)
-
mixed
$definition: Declaring function (with __FUNCTION__) or class with array(__CLASS__, __FUNCTION__)