class DrupalBoot6

  1. 8.0.x lib/Drush/Boot/DrupalBoot6.php DrupalBoot6
  2. 7.x lib/Drush/Boot/DrupalBoot6.php DrupalBoot6
  3. master lib/Drush/Boot/DrupalBoot6.php DrupalBoot6

Namespace

Drush\Boot

Hierarchy

Expanded class hierarchy of DrupalBoot6

Members

Contains filters are case sensitive
Namesort descending Modifiers Type Description
BaseBoot::bootstrap_and_dispatch function Main entrypoint to bootstrap the selected CMS and execute the selected command. Overrides Boot::bootstrap_and_dispatch
BaseBoot::terminate public function This method is called during the shutdown of drush. Overrides Boot::terminate
DrupalBoot6::add_logger function
DrupalBoot6::bootstrap_drupal_configuration function Initialize and load the Drupal configuration files. Overrides DrupalBoot::bootstrap_drupal_configuration
DrupalBoot6::bootstrap_drupal_core function
DrupalBoot6::bootstrap_drupal_database function Boostrap the Drupal database. Overrides DrupalBoot::bootstrap_drupal_database
DrupalBoot6::bootstrap_drupal_database_validate function Validate the DRUSH_BOOTSTRAP_DRUPAL_DATABASE phase Overrides DrupalBoot::bootstrap_drupal_database_validate
DrupalBoot6::bootstrap_drupal_full function Attempt to load the full Drupal system. Overrides DrupalBoot::bootstrap_drupal_full
DrupalBoot6::contrib_modules_paths function Overrides DrupalBoot::contrib_modules_paths
DrupalBoot6::contrib_themes_paths function Overrides DrupalBoot::contrib_themes_paths
DrupalBoot6::get_profile function Overrides DrupalBoot::get_profile
DrupalBoot6::get_version function Given a site root directory, determine the exact version of the software. Overrides DrupalBoot::get_version
DrupalBoot6::valid_root function This function determines if the specified path points to the root directory of a CMS that can be bootstrapped by the specific subclass that implements it. Overrides DrupalBoot::valid_root
DrupalBoot::bootstrap_do_drupal_site function Called by bootstrap_drupal_site to do the main work of the drush drupal site bootstrap.
DrupalBoot::bootstrap_drupal_database_has_table function Test to see if the Drupal database has a specified table or tables.
DrupalBoot::bootstrap_drupal_login function Log into the bootstrapped Drupal site with a specific username or user id.
DrupalBoot::bootstrap_drupal_root function Bootstrap Drush with a valid Drupal Directory.
DrupalBoot::bootstrap_drupal_root_validate function Validate the DRUSH_BOOTSTRAP_DRUPAL_ROOT phase.
DrupalBoot::bootstrap_drupal_site function Initialize a site on the Drupal root.
DrupalBoot::bootstrap_drupal_site_setup_server_global function Set up the $_SERVER globals so that Drupal will see the same values that it does when serving pages via the web server.
DrupalBoot::bootstrap_drupal_site_validate function VALIDATE the DRUSH_BOOTSTRAP_DRUPAL_SITE phase.
DrupalBoot::bootstrap_drupal_site_validate_settings_present function Validate that the Drupal site has all of the settings that it needs to operated.
DrupalBoot::bootstrap_init_phases function List of bootstrap phases where Drush should stop and look for commandfiles. Overrides Boot::bootstrap_init_phases
DrupalBoot::bootstrap_phases function Bootstrap phases used with Drupal: Overrides Boot::bootstrap_phases
DrupalBoot::commandfile_searchpaths function
DrupalBoot::command_defaults function Return an array of default values that should be added to every command (e.g. values needed in enforce_requirements(), etc.) Overrides BaseBoot::command_defaults
DrupalBoot::conf_path function
DrupalBoot::drush_command_belongs_to_disabled_module function Check if the given command belongs to a disabled module.
DrupalBoot::drush_enforce_requirement_drupal_dependencies function Check that a command has its declared dependencies available or have no dependencies.
DrupalBoot::enforce_requirement function Called by Drush when a command is selected, but before it runs. This gives the Boot class an opportunity to determine if any minimum requirements (e.g. minimum Drupal version) declared in the command have been met. Overrides BaseBoot::enforce_requirement
DrupalBoot::report_command_error function Called by Drush if a command is not found, or if the command was found, but did not meet requirements. Overrides BaseBoot::report_command_error
DrupalBoot::__construct function Overrides BaseBoot::__construct

File

lib/Drush/Boot/DrupalBoot6.php, line 5

View source
class DrupalBoot6 extends DrupalBoot {

  function valid_root($path) {
    if (!empty($path) && is_dir($path) && file_exists($path . '/index.php')) {
      // Drupal 6 root.
      // We check for the absence of 'modules/field/field.module' to differentiate this from a D7 site.
      // n.b. we want D5 and earlier to match here, if possible, so that we can print a 'not supported'
      // error durring bootstrap.  If someone later adds a commandfile that adds a boot class for
      // Drupal 5, it will be tested first, so we shouldn't get here.
      $candidate = 'includes/common.inc';
      if (file_exists($path . '/' . $candidate) && file_exists($path . '/misc/drupal.js') && !file_exists($path . '/modules/field/field.module')) {
        return $candidate;
      }
    }
  }

  function get_version($drupal_root) {
    $path = $drupal_root . '/modules/system/system.module';
    if (is_file($path)) {
      require_once $path;
      if (defined('VERSION')) {
        return VERSION;
      }
    }
  }

  function get_profile() {
    return variable_get('install_profile', 'standard');
  }

  function add_logger() {
    // If needed, prod module_implements() to recognize our system_watchdog() implementation.
    $dogs = drush_module_implements('watchdog');
    if (!in_array('system', $dogs)) {
      // Note that this resets module_implements cache.
      drush_module_implements('watchdog', FALSE, TRUE);
    }
  }

  function contrib_modules_paths() {
    return array(
      $this->conf_path() . '/modules',
      'sites/all/modules',
    );
  }

  function contrib_themes_paths() {
    return array(
      $this->conf_path() . '/themes',
      'sites/all/themes',
    );
  }

  function bootstrap_drupal_core($drupal_root) {
    define('DRUPAL_ROOT', $drupal_root);
    require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
    $core = DRUPAL_ROOT;

    return $core;
  }

  function bootstrap_drupal_database_validate() {
    return parent::bootstrap_drupal_database_validate() && $this->bootstrap_drupal_database_has_table('cache');
  }

  function bootstrap_drupal_database() {
    drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
    parent::bootstrap_drupal_database();
  }

  function bootstrap_drupal_configuration() {
    drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);

    parent::bootstrap_drupal_configuration();
  }

  function bootstrap_drupal_full() {
    if (!drush_get_context('DRUSH_QUIET', FALSE)) {
      ob_start();
    }
    drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
    if (!drush_get_context('DRUSH_QUIET', FALSE)) {
      ob_end_clean();
    }

    // Unset drupal error handler and restore drush's one.
    restore_error_handler();

    parent::bootstrap_drupal_full();
  }
}