function hook_boot

hook_boot()

Perform setup tasks for all page requests.

This hook is run at the beginning of the page request. It is typically used to set up global parameters that are needed later in the request.

Only use this hook if your code must run even for cached page views. This hook is called before the theme, modules, or most include files are loaded into memory. It happens while Drupal is still in bootstrap mode.

See also

hook_init()

Related topics

File

modules/system/system.api.php, line 1875
Hooks provided by Drupal core and the System module.

Code

function hook_boot() {
  // We need user_access() in the shutdown function. Make sure it gets loaded.
  drupal_load('module', 'user');
  drupal_register_shutdown_function('devel_shutdown');
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_boot/7.x