aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Extend
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-04-23 15:16:54 -0700
committerredmatrix <git@macgirvin.com>2016-04-23 15:16:54 -0700
commitdf2990b27ee1e55cfe68f8f532b6be76d176ba62 (patch)
tree0d461960855f66881cbb19e2891e913793b1e632 /Zotlabs/Extend
parenta8823ae7d8e3e87f4cee8d603f74996f1fe202c9 (diff)
downloadvolse-hubzilla-df2990b27ee1e55cfe68f8f532b6be76d176ba62.tar.gz
volse-hubzilla-df2990b27ee1e55cfe68f8f532b6be76d176ba62.tar.bz2
volse-hubzilla-df2990b27ee1e55cfe68f8f532b6be76d176ba62.zip
Class method support for hooks
Diffstat (limited to 'Zotlabs/Extend')
-rw-r--r--Zotlabs/Extend/Hook.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/Zotlabs/Extend/Hook.php b/Zotlabs/Extend/Hook.php
index 836b29db8..edfacfa3b 100644
--- a/Zotlabs/Extend/Hook.php
+++ b/Zotlabs/Extend/Hook.php
@@ -6,6 +6,10 @@ namespace Zotlabs\Extend;
class Hook {
static public function register($hook,$file,$function,$version = 1,$priority = 0) {
+ if(is_array($function)) {
+ $function = serialize($function);
+ }
+
$r = q("SELECT * FROM `hook` WHERE `hook` = '%s' AND `file` = '%s' AND `function` = '%s' and priority = %d and hook_version = %d LIMIT 1",
dbesc($hook),
dbesc($file),
@@ -28,6 +32,9 @@ class Hook {
}
static public function unregister($hook,$file,$function,$version = 1,$priority = 0) {
+ if(is_array($function)) {
+ $function = serialize($function);
+ }
$r = q("DELETE FROM hook WHERE hook = '%s' AND `file` = '%s' AND `function` = '%s' and priority = %d and hook_version = %d",
dbesc($hook),
dbesc($file),
@@ -63,6 +70,9 @@ class Hook {
*/
static public function insert($hook, $fn, $version = 0, $priority = 0) {
+ if(is_array($fn)) {
+ $fn = serialize($fn);
+ }
if(! is_array(App::$hooks))
App::$hooks = array();