function ultimate_cron_register_shutdown_function in Ultimate Cron 7.2
Same name and namespace in other branches
- 8.2 ultimate_cron.module \ultimate_cron_register_shutdown_function()
Registers a function for execution on shutdown.
Wrapper for register_shutdown_function() that catches thrown exceptions to avoid "Exception thrown without a stack frame in Unknown".
This is a duplicate of the built-in functionality in Drupal, however we need to perform our tasks before that.
Parameters
callback $callback: The shutdown function to register.
...: Additional arguments to pass to the shutdown function.
See also
3 calls to ultimate_cron_register_shutdown_function()
- UltimateCronLock::lock in ./
ultimate_cron.lock.inc - Acquire lock.
- UltimateCronLockMemcache::lock in ./
ultimate_cron.memcache-lock.inc - Acquire lock.
- UltimateCronLogger::catchMessages in ./
ultimate_cron.plugin.inc - Begin capturing messages.
File
- ./
ultimate_cron.module, line 89
Code
function ultimate_cron_register_shutdown_function($callback) {
$args = func_get_args();
array_shift($args);
$GLOBALS['ultimate_cron_shutdown_functions'][] = array(
'callback' => $callback,
'arguments' => $args,
);
}