drupal_exit

Versions
7
drupal_exit($destination = NULL)

Perform end-of-request tasks.

In some cases page requests need to end without calling drupal_page_footer(). In these cases, call drupal_exit() instead. 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.

▾ 15 functions call drupal_exit()

ajax_get_form in includes/ajax.inc
Get a form submitted via #ajax during an AJAX callback.
ajax_render in includes/ajax.inc
Render a commands array into JSON and exit.
dashboard_show_block_content in modules/dashboard/dashboard.module
AJAX callback to display the rendered contents of a specific block.
dashboard_show_disabled in modules/dashboard/dashboard.module
AJAX callback to show disabled blocks in the dashboard customization mode.
dashboard_update in modules/dashboard/dashboard.module
Set the new weight of each region according to the drag-and-drop order.
drupal_goto in includes/common.inc
Send the user to a different Drupal page.
file_transfer in includes/file.inc
Transfer file using HTTP to client. Pipes a file through Drupal to the client.
image_style_generate in modules/image/image.module
Menu callback; Given a style and image path, generate a derivative.
install_goto in includes/install.inc
Send the user to a different installer page.
openid_redirect in modules/openid/openid.inc
Creates a js auto-submit redirect for (for the 2.x protocol)
openid_redirect_http in modules/openid/openid.inc
Performs an HTTP 302 redirect (for the 1.x protocol).
system_php in modules/system/system.admin.inc
Menu callback: return information about PHP.
system_run_cron_image in modules/system/system.module
Menu callback; executes cron via an image callback.
upload_js in modules/upload/upload.module
Menu-callback for JavaScript-based uploads.
xmlrpc_server_output in includes/xmlrpcs.inc

Code

includes/common.inc, line 2958

<?php
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;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.