You are here

function ultimate_cron_register_shutdown_function in Ultimate Cron 8.2

Same name and namespace in other branches
  1. 7.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

register_shutdown_function()

3 calls to ultimate_cron_register_shutdown_function()
Lock::lock in src/Lock/Lock.php
Acquire lock.
LockMemcache::lock in src/Lock/LockMemcache.php
Acquire lock.
WatchdogLogger::catchMessages in src/Logger/WatchdogLogger.php
Begin capturing messages.

File

./ultimate_cron.module, line 83
Ultimate Cron. Extend cron functionality in Drupal.

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,
  );
}