class EmptyBoot

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

This is a do-nothing 'Boot' class that is used when there is no site at --root, or when no root is specified.

The 'empty' boot must be careful to never change state, in case bootstrap code might later come along and set a site (e.g. in command completion).




Expanded class hierarchy of EmptyBoot


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::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 Boot::enforce_requirement
BaseBoot::get_version function Given a site root directory, determine the exact version of the software. Overrides Boot::get_version
BaseBoot::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 Boot::report_command_error
BaseBoot::terminate public function This method is called during the shutdown of drush. Overrides Boot::terminate
EmptyBoot::bootstrap_init_phases function List of bootstrap phases where Drush should stop and look for commandfiles. Overrides Boot::bootstrap_init_phases
EmptyBoot::bootstrap_phases function Returns an array that determines what bootstrap phases are necessary to bootstrap this CMS. This array should map from a numeric phase to the name of a method (string) in the Boot class that handles the bootstrap phase. Overrides Boot::bootstrap_phases
EmptyBoot::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
EmptyBoot::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 BaseBoot::valid_root
EmptyBoot::__construct function Overrides BaseBoot::__construct


lib/Drush/Boot/EmptyBoot.php, line 13

View source
class EmptyBoot extends BaseBoot {

  function __construct() {

  function valid_root($path) {
    return FALSE;

  function bootstrap_phases() {
    return array(
      DRUSH_BOOTSTRAP_DRUSH => '_drush_bootstrap_drush',

  function bootstrap_init_phases() {
    return array(DRUSH_BOOTSTRAP_DRUSH);

  function command_defaults() {
    return array(
      // TODO: Historically, commands that do not explicitly specify
      // their bootstrap level default to DRUSH_BOOTSTRAP_DRUPAL_LOGIN.
      // This isn't right any more, but we can't just change this to
      // DRUSH_BOOTSTRAP_DRUSH, or we will start running commands that
      // needed a full bootstrap with no bootstrap, and that won't work.
      // For now, we will continue to force this to 'login'.  Any command
      // that does not declare 'bootstrap' is declaring that it is a Drupal
      // command.
      'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_LOGIN,