You are here

function domain_bootstrap in Domain Access 6.2

Same name and namespace in other branches
  1. 7.3 domain.bootstrap.inc \domain_bootstrap()
  2. 7.2 domain.bootstrap.inc \domain_bootstrap()

Domain module bootstrap: calls all bootstrap phases.

1 call to domain_bootstrap()
settings.inc in ./settings.inc
settings.inc

File

./domain.bootstrap.inc, line 40
Domain bootstrap file.

Code

function domain_bootstrap() {
  global $_domain;

  // Initialize our global variable.
  $_domain = array();
  $phases = array(
    DOMAIN_BOOTSTRAP_INIT,
    DOMAIN_BOOTSTRAP_NAME_RESOLVE,
    DOMAIN_BOOTSTRAP_FULL,
  );
  foreach ($phases as $phase) {

    // We return NULL if the domain module is not enabled.  This prevents
    // load errors during module enable / disable.
    $error = _domain_bootstrap($phase);
    if ($error === NULL) {
      $_domain['error'] = -1;
      break;
    }
    else {
      if ($error === FALSE) {

        // watchdog() is not available here, and there may be other logging.
        // So we have to write an error message global variable and pick them up in settings,inc.
        $_domain['error'] = $phase;
        break;
      }
    }
  }
}