You are here

function dynamic_cache_boot in Dynamic Cache 7

Same name and namespace in other branches
  1. 6 dynamic_cache.module \dynamic_cache_boot()

Implements hook_boot().

File

./dynamic_cache.module, line 15
Dynamic Cache module.

Code

function dynamic_cache_boot() {
  if (dynamic_cache_should_run()) {

    // Overwrite cache header.
    header('X-Drupal-Cache: MISS');

    // Re-run full bootstrap and menu handler from index.php.
    // PROBLEM: this causes hook_boot() to be invoked a 2nd time, so we use
    // dynamic_cache_bootfix to setup ANOTHER boot hijacking to catch that.
    drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL, true);

    // Bootstrap is finished, now run menu handler from index.php.
    // (Currently, this code is never actually reached due to the bootfix module
    // hijacking the above bootstrap() call, but leaving it in just in case.)
    menu_execute_active_handler();

    // We're done.
    exit;
  }
}