Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.196 diff -u -F^f -r1.196 bootstrap.inc --- includes/bootstrap.inc 17 Oct 2007 13:03:03 -0000 1.196 +++ includes/bootstrap.inc 18 Oct 2007 23:23:04 -0000 @@ -884,6 +884,11 @@ function _drupal_bootstrap($phase) { switch ($phase) { case DRUPAL_BOOTSTRAP_CONFIGURATION: + // Start a page timer. Since this is to track how long this + // page takes, we want to start it as early as possible. The + // function is fast enough not to matter when we call it. + timer_start('page'); + drupal_unset_globals(); // Initialize the configuration conf_init(); @@ -918,12 +923,14 @@ function _drupal_bootstrap($phase) { // Initialize configuration variables, using values from settings.php if available. $conf = variable_init(isset($conf) ? $conf : array()); + // Load the page from cache if found and exit. _drupal_cache_init($phase); - // Start a page timer: - timer_start('page'); - + // _drupal_cache_init calls hook_boot if appropriate for a cache + // hit but not for a non-cached page. bootstrap_invoke_all('boot'); + + // Prepare for non-cached page workflow. drupal_page_header(); break; @@ -964,6 +971,7 @@ function _drupal_cache_init($phase) { } elseif (variable_get('cache', CACHE_DISABLED) == CACHE_NORMAL) { require_once './includes/module.inc'; + bootstrap_invoke_all('boot'); drupal_page_cache_header($cache); bootstrap_invoke_all('exit'); exit();