function hook_boot

7.x system.api.php hook_boot()
6.x core.php 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

2 string references to 'hook_boot'
HookBootExitTestCase::testHookBootExit in drupal-7.x/modules/simpletest/tests/bootstrap.test
Test calling of hook_boot() and hook_exit().
system_test_boot in drupal-7.x/modules/simpletest/tests/system_test.module
Implements hook_boot().
3 functions implement hook_boot()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

locale_test_boot in drupal-7.x/modules/locale/tests/locale_test.module
Implements hook_boot().
session_test_boot in drupal-7.x/modules/simpletest/tests/session_test.module
Implements hook_boot().
system_test_boot in drupal-7.x/modules/simpletest/tests/system_test.module
Implements hook_boot().
2 invocations of hook_boot()
_drupal_bootstrap_page_cache in drupal-7.x/includes/bootstrap.inc
Attempts to serve a page from the cache.
_drupal_bootstrap_page_header in drupal-7.x/includes/bootstrap.inc
Invokes hook_boot(), initializes locking system, and sends HTTP headers.

File

drupal-7.x/modules/system/system.api.php, line 1861
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');
}