summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/kolab_hooks.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/kolab_hooks.php b/lib/kolab_hooks.php
index 1ffff31..9a91188 100644
--- a/lib/kolab_hooks.php
+++ b/lib/kolab_hooks.php
@@ -58,6 +58,20 @@ class kolab_hooks {
}
/**
+ * check if callbacks are registered for a given hook
+ *
+ * @static
+ * @param string $hook Hook name
+ * @return bool
+ */
+ public static function exists($hook)
+ {
+ return isset(self::$handlers[$hook])
+ && is_array(self::$handlers[$hook])
+ && count(self::$handlers[$hook]);
+ }
+
+ /**
* register a callback function for a certain hook
*
* @static