vBulletin 5.6.5 API

vB_Utility_Hook_Live
in package
Uses vB_Utility_Trait_NoSerialize

Table of Contents

$active_hooks  : mixed
$hook_classes  : mixed
__construct()  : mixed
__serialize()  : mixed
__sleep()  : mixed
__unserialize()  : mixed
__wakeup()  : mixed
invoke()  : mixed
sortHooks()  : mixed
Sort the hook classes according to their order variable.

Properties

$active_hooks

private mixed $active_hooks = array()

$hook_classes

private mixed $hook_classes = array()

Methods

__construct()

public __construct(mixed $hook_classes) : mixed
Parameters
$hook_classes : mixed
Return values
mixed

__serialize()

public __serialize() : mixed
Return values
mixed

__sleep()

public __sleep() : mixed
Return values
mixed

__unserialize()

public __unserialize(mixed $serialized) : mixed
Parameters
$serialized : mixed
Return values
mixed

__wakeup()

public __wakeup() : mixed
Return values
mixed

invoke()

public invoke(mixed $hook_name, mixed $params) : mixed
Parameters
$hook_name : mixed
$params : mixed
Return values
mixed

sortHooks()

Sort the hook classes according to their order variable.

private sortHooks(mixed $hook_classes) : mixed

This is necesary because the PHP interal sorts are not stable. Hooks with the same order are going to be common (in fact we have a special case for when they are all the same as that's the most likely case). While we don't particularly care what order hook classes with the same order end up in, we do care that they are consistant between page loads (it does not appear to be a problem with the current PHP implementation, but some QuickSort implementations like to permute the array first) and between versions of PHP. I'm not sufficient confident in the latter going forward to rely on it. Not that we do use ksort, but the keys of the array are guarenteed to be unique.

Parameters
$hook_classes : mixed
Return values
mixed

Search results