function _messaging_callback_invoke in Messaging 6.2
Same name and namespace in other branches
- 6.4 messaging.module \_messaging_callback_invoke()
- 6 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
5 calls to _messaging_callback_invoke()
- Messaging_API_Tests::testMessagingBasicAPI in tests/
messaging_api.test - Exercise basic API functions
- messaging_message_invoke in ./
messaging.module - Invoke callbacks
- messaging_message_send_out in ./
messaging.module - Send for real, finally invoking method's callback function
- messaging_message_send_user in ./
messaging.module - Send message to user represented by account
- messaging_user_destination in ./
messaging.module - Get destination from user account.
File
- ./
messaging.module, line 1080
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);
}