/var-www-hotglue/hotglue.org-test/dev/modules.inc.php File Reference

Go to the source code of this file.

Functions

if(!isset($hooks)) if(!isset($modules))
if(!isset($services)) 
get_hooks ()
 get_modules ()
 get_service ($service)
 invoke_hook ($hook, $args=array(), $first_module= '', $last_module= '')
 invoke_hook_first ($hook, $first_module, $args=array())
 invoke_hook_last ($hook, $last_module, $args=array())
 invoke_hook_while ($hook, $while, $args=array())
 load_modules ($search= '', $optional=false)
 register_service ($service, $func, $args=array())
 register_hook ($hook, $info= '')
 response ($data, $error=false)
 run_service ($service, $args=array())

Function Documentation

if (!isset($hooks)) if (!isset($modules)) if (!isset($services)) get_hooks (  ) 

get an array of all currently registered hooks

Returns:
array

Definition at line 31 of file modules.inc.php.

get_modules (  ) 

get an array of all currently loaded modules

Returns:
array

Definition at line 43 of file modules.inc.php.

get_service ( service  ) 

return a service-array

call load_modules() before calling this function.

Parameters:
string $service service name
Returns:
array or false if not found

Definition at line 59 of file modules.inc.php.

invoke_hook ( hook,
args = array(),
first_module = '',
last_module = '' 
)

invoke a hook

this function also takes care of loading all modules.

Parameters:
string $hook hook to invoke
array $args arguments-array (can include references)
string $first_module first module to call (optional)
string $last_module last module to call (optional)
Returns:
array of results (module=>result)

Definition at line 80 of file modules.inc.php.

invoke_hook_first ( hook,
first_module,
args = array() 
)

invoke a hook with a specified module being called first

this function also takes care of loading all modules.

Parameters:
string $hook hook to invoke
string $first_module name of first module to call
array $args arguments-array (can include references)
Returns:
array of results (module=>result)

Definition at line 133 of file modules.inc.php.

invoke_hook_last ( hook,
last_module,
args = array() 
)

invoke a hook with a specified module being called last

this function also takes care of loading all modules.

Parameters:
string $hook hook to invoke
string $last_module name of last module to call
array $args arguments-array (can include references)
Returns:
array of results (module=>result)

Definition at line 148 of file modules.inc.php.

invoke_hook_while ( hook,
while,
args = array() 
)

invoke a hook while the returned result is $while

this function also takes care of loading all modules.

Parameters:
string $hook hook to invoke
mixed $while value to compare the returned result with
array $args arguments-array
Returns:
array with result (module=>result) or empty result if there was none

Definition at line 163 of file modules.inc.php.

load_modules ( search = '',
optional = false 
)

load modules

use this function instead of including module_* files directly.

Parameters:
string $search module to load (by default all modules are loaded)
bool $optional whether to log any error to locate the module
Returns:
bool true if successful, false if not

Definition at line 198 of file modules.inc.php.

register_hook ( hook,
info = '' 
)

register a hook

this function is for information purposes only. you can also use a hook without registering it here. this is not recommended though.

Parameters:
string $hook hook name
string $info some words on the hook's purpose

Definition at line 276 of file modules.inc.php.

register_service ( service,
func,
args = array() 
)

register a service

you can specify the service's arguments in $args['args']. see run_services().

Parameters:
string $service service name
string $func function name
array $args optional arguments

Definition at line 259 of file modules.inc.php.

response ( data,
error = false 
)

return a response-array

Parameters:
mixed $data (payload) data (should be the error-message if $error is true)
mixed $error error core or true if an error occurred
Returns:
array

Definition at line 293 of file modules.inc.php.

run_service ( service,
args = array() 
)

run a service

this function checks the arguments in $args against the (optional) declaration given in register_service().

Parameters:
string $service service name
array $args arguments-array
Returns:
return value of the service function or a response-array in case of an error

Definition at line 319 of file modules.inc.php.

Generated on Wed Jul 11 19:43:16 2012 for hotglue by  doxygen 1.6.3