&drupal_register_shutdown_function($callback = NULL, $parameters = NULL)Register a function for execution on shutdown.
Wrapper for register_shutdown_function() which catches thrown exceptions to avoid "Exception thrown without a stack frame in Unknown".
$callback The shutdown function to register.
$parameters It is possible to pass parameters to the shutdown function by passing additional parameters.
Array of shutdown functions to be executed.
includes/bootstrap.inc, line 2663
<?php
function &drupal_register_shutdown_function($callback = NULL, $parameters = NULL) {
// We cannot use drupal_static() here because the static cache is reset
// during batch processing, which breaks batch handling.
static $callbacks = array();
if (isset($callback)) {
// Only register the internal shutdown function once.
if (empty($callbacks)) {
register_shutdown_function('_drupal_shutdown_function');
}
$args = func_get_args();
array_shift($args);
// Save callback and arguments
$callbacks[] = array('callback' => $callback, 'arguments' => $args);
}
return $callbacks;
}
?>