phpLDAPadmin
[ class tree: phpLDAPadmin ] [ index: phpLDAPadmin ] [ all elements ]

Procedural File: hooks.php

Source Location: /lib/hooks.php



Page Details:

Functions related to hooks management.



Tags:

filesource:  Source Code for this file
author:  Benjamin Drieu <benjamin.drieu@fr.alcove.com> and AlcĂ?ve


Includes:

require_once("$filename") [line 179]






add_hook [line 111]

void add_hook( hook_name $hook_name, priority $priority, hook_function $hook_function, rollback_function $rollback_function)

Adds a procedure to a hook for later execution.



Parameters

hook_name   $hook_name   Name of the hook.
priority   $priority   Numeric priority. Lowest means procedure will be executed before.
hook_function   $hook_function   Name of the php function called upon hook trigger.
rollback_function   $rollback_function   Name of the php rollback function called upon failure.
[ Top ]



clear_hooks [line 162]

void clear_hooks( hook_name $hook_name)

Removes all procedures from a hook.



Parameters

hook_name   $hook_name   Name of hook to clear.
[ Top ]



remove_hook [line 140]

void remove_hook( hook_name $hook_name, priority $priority, hook_function $hook_function, rollback_function $rollback_function)

Removes a procedure from a hook, based on a filter.



Parameters

hook_name   $hook_name   Name of the hook.
priority   $priority   Numeric priority. If set, all procedures of that priority will be removed.
hook_function   $hook_function   Name of the procedure function. If set, all procedures that call this function will be removed.
rollback_function   $rollback_function   Name of the php rollback function called upon failure. If set, all procedures that call this function as a rollback will be removed.
[ Top ]



run_hook [line 52]

true run_hook( hook_name $hook_name, args $args)

Runs procedures attached to a hook.



Tags:

return:  if all procedures returned true, false otherwise.


Parameters

hook_name   $hook_name   Name of hook to run.
args   $args   Array of optional arguments set by phpldapadmin. It is normally in a form known by call_user_func_array() :
[ 'server_id' => 0,
 'dn' => 'uid=epoussa,ou=tech,o=corp,o=fr' ]
[ Top ]



sort_array_by_priority [line 36]

-1 sort_array_by_priority( a $a, b $b)

Compares two arrays by numerically comparing their 'prority' value. Standard `cmp-like' function.



Tags:

return:  if priority of first element is smaller than second element priority. 1 otherwise.


Parameters

a   $a   First element to compare.
b   $b   Second element to compare.
[ Top ]



Documentation generated on Sun, 30 Dec 2007 17:50:07 -0800 by phpDocumentor 1.3.1