DrupalBoot6.php

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

Namespace

Drush\Boot

Classes

Namesort descending Description
DrupalBoot6

File

lib/Drush/Boot/DrupalBoot6.php
View source
  1. <?php
  2. namespace Drush\Boot;
  3. class DrupalBoot6 extends DrupalBoot {
  4. function valid_root($path) {
  5. if (!empty($path) && is_dir($path) && file_exists($path . '/index.php')) {
  6. // Drupal 6 root.
  7. // We check for the absence of 'modules/field/field.module' to differentiate this from a D7 site.
  8. // n.b. we want D5 and earlier to match here, if possible, so that we can print a 'not supported'
  9. // error durring bootstrap. If someone later adds a commandfile that adds a boot class for
  10. // Drupal 5, it will be tested first, so we shouldn't get here.
  11. $candidate = 'includes/common.inc';
  12. if (file_exists($path . '/' . $candidate) && file_exists($path . '/misc/drupal.js') && !file_exists($path . '/modules/field/field.module')) {
  13. return $candidate;
  14. }
  15. }
  16. }
  17. function get_profile() {
  18. return variable_get('install_profile', 'standard');
  19. }
  20. function add_logger() {
  21. // If needed, prod module_implements() to recognize our system_watchdog() implementation.
  22. $dogs = drush_module_implements('watchdog');
  23. if (!in_array('system', $dogs)) {
  24. // Note that this resets module_implements cache.
  25. drush_module_implements('watchdog', FALSE, TRUE);
  26. }
  27. }
  28. function contrib_modules_paths() {
  29. return array(
  30. conf_path() . '/modules',
  31. 'sites/all/modules',
  32. );
  33. }
  34. function contrib_themes_paths() {
  35. return array(
  36. conf_path() . '/themes',
  37. 'sites/all/themes',
  38. );
  39. }
  40. function bootstrap_drupal_core($drupal_root) {
  41. define('DRUPAL_ROOT', $drupal_root);
  42. $core = DRUPAL_ROOT;
  43. return $core;
  44. }
  45. function bootstrap_drupal_database_validate() {
  46. return parent::bootstrap_drupal_database_validate() && $this->bootstrap_drupal_database_has_table('cache');
  47. }
  48. function bootstrap_drupal_database() {
  49. drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
  50. parent::bootstrap_drupal_database();
  51. }
  52. function bootstrap_drupal_configuration() {
  53. drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
  54. parent::bootstrap_drupal_configuration();
  55. }
  56. function bootstrap_drupal_full() {
  57. if (!drush_get_context('DRUSH_QUIET', FALSE)) {
  58. ob_start();
  59. }
  60. drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
  61. if (!drush_get_context('DRUSH_QUIET', FALSE)) {
  62. ob_end_clean();
  63. }
  64. // Unset drupal error handler and restore drush's one.
  65. restore_error_handler();
  66. parent::bootstrap_drupal_full();
  67. }
  68. }