5 use Psr\Log\LoggerInterface;
7 class DrupalBoot7 extends DrupalBoot
10 public function validRoot($path)
12 if (!empty($path) && is_dir($path) && file_exists($path . '/index.php')) {
14 // We check for the presence of 'modules/field/field.module' to differentiate this from a D6 site
15 $candidate = 'includes/common.inc';
16 if (file_exists($path . '/' . $candidate) && file_exists($path . '/misc/drupal.js') && file_exists($path . '/modules/field/field.module')) {
22 public function getVersion($drupal_root)
24 $path = $drupal_root . '/includes/bootstrap.inc';
27 if (defined('VERSION')) {
33 public function getProfile()
35 return drupal_get_profile();
38 public function addLogger()
42 public function bootstrapDrupalCore($drupal_root)
44 define('DRUPAL_ROOT', $drupal_root);
45 require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
51 public function bootstrapDrupalDatabaseValidate()
53 return parent::bootstrapDrupalDatabaseValidate() && $this->bootstrapDrupalDatabaseHasTable('blocked_ips');
56 public function bootstrapDrupalDatabase()
58 drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
59 parent::bootstrapDrupalDatabase();
62 public function bootstrapDrupalConfiguration()
64 drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
66 // Unset drupal error handler and restore drush's one.
67 restore_error_handler();
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 parent::bootstrapDrupalFull();