function drupal_exit

Performs end-of-request tasks.

There should rarely be a reason to call exit instead of drupal_exit();

Parameters

$destination: If this function is called from drupal_goto(), then this argument will be a fully-qualified URL that is the destination of the redirect. This should be passed along to hook_exit() implementations.

12 calls to drupal_exit()
ajax_get_form in drupal/core/includes/ajax.inc
Gets a form submitted via #ajax during an Ajax callback.
drupal_goto in drupal/core/includes/common.inc
Sends the user to a different Drupal page.
image_style_deliver in drupal/core/modules/image/image.module
Menu callback; Given a style and image path, generate a derivative.
install_goto in drupal/core/includes/install.inc
Sends the user to a different installer page.
locale_translate_export_form_submit in drupal/core/modules/locale/locale.bulk.inc
Form submission handler for locale_translate_export_form().

... See full list

File

drupal/core/includes/common.inc, line 2274
Common functions that many Drupal modules will need to reference.

Code

function drupal_exit($destination = NULL) {
  if (drupal_get_bootstrap_phase() == DRUPAL_BOOTSTRAP_FULL) {
    if (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update') {
      module_invoke_all('exit', $destination);
    }
    drupal_session_commit();
  }
  exit;
}