+ /**
+ * @brief Forks a hook.
+ *
+ * Use this function when you want to fork a hook via the worker.
+ *
+ * @param string $name of the hook to call
+ * @param string|array $data to transmit to the callback handler
+ */
+ public static function forkHooks($priority, $name, $data = null)
+ {
+ $a = get_app();
+
+ if (is_array($a->hooks) && array_key_exists($name, $a->hooks)) {
+ foreach ($a->hooks[$name] as $hook) {
+ Worker::add($priority, 'ForkHook', $name, $hook, $data);
+ }
+ }
+ }
+