function _messaging_callback_invoke in Messaging 6.4
Same name and namespace in other branches
- 6 messaging.module \_messaging_callback_invoke()
- 6.2 messaging.module \_messaging_callback_invoke()
- 6.3 messaging.module \_messaging_callback_invoke()
Invoke callback with variable arguments
We don't check whether the function exists so it will crash if it's missing
Parameters
$callback: Function name or array(function, arg1, arg2..)
$arg1, $arg2...: Variable number of arguments
File
- ./
messaging.module, line 684
Code
function _messaging_callback_invoke() {
$args = func_get_args();
$callback = array_shift($args);
if (is_array($callback)) {
// It is an array: function, arg1, arg2...
$function = array_shift($callback);
$params = $callback;
}
else {
// It is just a function name
$function = $callback;
$params = array();
}
// Merge parameters and go for it
$params = array_merge($params, $args);
return call_user_func_array($function, $params);
}