_domain_bootstrap

Versions
domain
_domain_bootstrap($phase)

Calls individual bootstrap phases.

Parameters

$phase The domain bootstrap phase to call.

Return value

Returns TRUE if the bootstrap phase was successful and FALSE otherwise.

Code

./domain.bootstrap.inc, line 72

<?php
function _domain_bootstrap($phase) {
  global $_domain;
  switch ($phase) {
    case DOMAIN_BOOTSTRAP_INIT:
      // Make sure database is loaded
      drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
      // If the module has been disabled, stop loading.
      $table = domain_get_primary_table('system');
      $check = db_result(db_query("SELECT status FROM $table WHERE name = 'domain' AND type = 'module'"));
      if (empty($check)) {
        return NULL;
      }

      // Load bootstrap modules registered by Domain Access.
      _domain_bootstrap_modules_load();

      // If essential core module file has not been loaded, bootstrap fails.
      if (!function_exists('domain_load')) {
        return FALSE;
      }
      break;

    case DOMAIN_BOOTSTRAP_NAME_RESOLVE:
      // Get the domain_id of the request.
      $_domain = domain_resolve_host();
      // If we don't have a valid domain id now, we can't really go on, bootstrap fails.
      if (empty($_domain) || !is_numeric($_domain['domain_id'])) {
        return FALSE;
      }
      break;

    case DOMAIN_BOOTSTRAP_FULL:
      // Make sure the load process worked correctly before invoking the hook.
      if (!domain_settings_setup_ok()) {
        return FALSE;
      }
      _domain_bootstrap_invoke_all('full', $_domain);
      break;
  }
  return TRUE;
}
?>

Contact

  • agentrickard [at] gmail [dot] com

Donations

My Amazon.com Wish List