EmptyBoot.php

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

Namespace

Drush\Boot

Classes

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

File

lib/Drush/Boot/EmptyBoot.php
View source
  1. <?php
  2. namespace Drush\Boot;
  3. use Psr\Log\LoggerInterface;
  4. /**
  5. * This is a do-nothing 'Boot' class that is used when there
  6. * is no site at --root, or when no root is specified.
  7. *
  8. * The 'empty' boot must be careful to never change state,
  9. * in case bootstrap code might later come along and set
  10. * a site (e.g. in command completion).
  11. */
  12. class EmptyBoot extends BaseBoot {
  13. function valid_root($path) {
  14. return FALSE;
  15. }
  16. function bootstrap_phases() {
  17. return array(
  18. DRUSH_BOOTSTRAP_DRUSH => '_drush_bootstrap_drush',
  19. );
  20. }
  21. function bootstrap_init_phases() {
  22. return array(DRUSH_BOOTSTRAP_DRUSH);
  23. }
  24. function command_defaults() {
  25. return array(
  26. // TODO: Historically, commands that do not explicitly specify
  27. // their bootstrap level default to DRUSH_BOOTSTRAP_DRUPAL_LOGIN.
  28. // This isn't right any more, but we can't just change this to
  29. // DRUSH_BOOTSTRAP_DRUSH, or we will start running commands that
  30. // needed a full bootstrap with no bootstrap, and that won't work.
  31. // For now, we will continue to force this to 'login'. Any command
  32. // that does not declare 'bootstrap' is declaring that it is a Drupal
  33. // command.
  34. 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_LOGIN,
  35. );
  36. }
  37. }