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.
This commit is contained in:
@@ -512,10 +512,12 @@ CREATE TABLE "hook" (
|
||||
"file" text NOT NULL,
|
||||
"function" text NOT NULL,
|
||||
"priority" bigint NOT NULL DEFAULT '0',
|
||||
"hook_version" smallint NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY ("id")
|
||||
|
||||
);
|
||||
create index "hook_idx" on hook ("hook");
|
||||
create index "hook_version_idx" on hook ("hook_version");
|
||||
CREATE TABLE "hubloc" (
|
||||
"hubloc_id" serial NOT NULL,
|
||||
"hubloc_guid" text NOT NULL DEFAULT '',
|
||||
|
Reference in New Issue
Block a user