5 * This file is required for recognizing a D6 root and showing deprecation error.
10 use Psr\Log\LoggerInterface;
12 class DrupalBoot6 extends DrupalBoot
15 public function validRoot($path)
17 if (!empty($path) && is_dir($path) && file_exists($path . '/index.php')) {
19 // We check for the absence of 'modules/field/field.module' to differentiate this from a D7 site.
20 // n.b. we want D5 and earlier to match here, if possible, so that we can print a 'not supported'
21 // error during bootstrap. If someone later adds a commandfile that adds a boot class for
22 // Drupal 5, it will be tested first, so we shouldn't get here.
23 $candidate = 'includes/common.inc';
24 if (file_exists($path . '/' . $candidate) && file_exists($path . '/misc/drupal.js') && !file_exists($path . '/modules/field/field.module')) {
30 public function getVersion($drupal_root)
32 $path = $drupal_root . '/modules/system/system.module';
35 if (defined('VERSION')) {
41 public function addLogger()
45 public function bootstrapDrupalCore($drupal_root)
47 define('DRUPAL_ROOT', $drupal_root);
48 require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
54 public function bootstrapDrupalDatabaseValidate()
56 return parent::bootstrapDrupalDatabaseValidate() && $this->bootstrapDrupalDatabaseHasTable('cache');
59 public function bootstrapDrupalDatabase()
61 drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
62 parent::bootstrapDrupalDatabase();
65 public function bootstrapDrupalConfiguration()
67 drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
69 parent::bootstrapDrupalConfiguration();
72 public function bootstrapDrupalFull()
74 if (!drush_get_context('DRUSH_QUIET', false)) {
77 drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
78 if (!drush_get_context('DRUSH_QUIET', false)) {
82 // Unset drupal error handler and restore drush's one.
83 restore_error_handler();
85 parent::bootstrapDrupalFull();