The Hubzilla
 All Classes Namespaces Files Functions Variables Pages
Zotlabs\Extend\Hook Class Reference

Hook class. More...

Static Public Member Functions

static register ($hook, $file, $function, $version=1, $priority=0)
 
static register_array ($file, $arr)
 
static unregister ($hook, $file, $function, $version=1, $priority=0)
 
static unregister_by_file ($file)
 Unregister all hooks with this file component. More...
 
static insert ($hook, $fn, $version=0, $priority=0)
 Inserts a hook into a page request. More...
 

Detailed Description

Hook class.

Member Function Documentation

static Zotlabs\Extend\Hook::insert (   $hook,
  $fn,
  $version = 0,
  $priority = 0 
)
static

Inserts a hook into a page request.

Insert a short-lived hook into the running page request. Hooks are normally persistent so that they can be called across asynchronous processes such as delivery and poll processes.

insert_hook lets you attach a hook callback immediately which will not persist beyond the life of this page request or the current process.

Parameters
string$hookname of hook to attach callback
string$fnfunction name of callback handler
int$versionhook interface version, 0 uses two callback params, 1 uses one callback param
int$prioritycurrently not implemented in this function, would require the hook array to be resorted
static Zotlabs\Extend\Hook::register (   $hook,
  $file,
  $function,
  $version = 1,
  $priority = 0 
)
static
static Zotlabs\Extend\Hook::register_array (   $file,
  $arr 
)
static
static Zotlabs\Extend\Hook::unregister (   $hook,
  $file,
  $function,
  $version = 1,
  $priority = 0 
)
static
static Zotlabs\Extend\Hook::unregister_by_file (   $file)
static

Unregister all hooks with this file component.

Useful for addon upgrades where you want to clean out old interfaces.

Parameters
string$file

The documentation for this class was generated from the following file: