1. drupal
    1. 6 core.php
    2. 8
    3. 7
6 – 7 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 modules or most include files are loaded into memory. It happens while Drupal is still in bootstrap mode.

See also


Related topics


modules/system/system.api.php, line 1758

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