aboutsummaryrefslogtreecommitdiffstats
path: root/install/update.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-04-21 17:03:05 -0700
committerredmatrix <git@macgirvin.com>2016-04-21 17:03:05 -0700
commit1ff189ee907e6465dfb35118f789f10e714d38a1 (patch)
tree7c91b24d605a13ff9f36cacfd5c8d7c1c23ec9ed /install/update.php
parent692e41c41ea54f6957c93b901a5ed4a437969691 (diff)
downloadvolse-hubzilla-1ff189ee907e6465dfb35118f789f10e714d38a1.tar.gz
volse-hubzilla-1ff189ee907e6465dfb35118f789f10e714d38a1.tar.bz2
volse-hubzilla-1ff189ee907e6465dfb35118f789f10e714d38a1.zip
new hook interface (the old one still works but requires handlers to have two calling arguments; the first of which is no longer used). The new interface is called from Zotlabs\Extend\Hook::register() and allows you to specify which hook version to use. The default will be the new interface with one function argument. We also implement the hook priority field which was always there but needed to be set manually in the DB. This provides a way for two hook handlers that implement the same hook interface to determine which order to be called in the event of conflicts.
Diffstat (limited to 'install/update.php')
-rw-r--r--install/update.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/install/update.php b/install/update.php
index bfd01494f..2dc4a6db3 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1165 );
+define( 'UPDATE_VERSION' , 1166 );
/**
*
@@ -2058,3 +2058,16 @@ function update_r1164() {
return UPDATE_FAILED;
}
+function update_r1165() {
+
+ $r1 = q("alter table hook add hook_version int not null default '0' ");
+
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES)
+ $r2 = q("create index \"hook_version_idx\" on hook (\"hook_version\") ");
+ else
+ $r2 = q("alter table hook add index ( hook_version ) ");
+ if($r1 && $r2)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+