/** * Validate the BackdropBoot::BOOTSTRAP_SITE phase. * * In this function we determine the URL used for the command, and check for a * valid settings.php file. * * To do this, we need to set up the $_SERVER environment variable, * to allow us to use conf_path() to determine what Backdrop will load * as a configuration file. */ function bootstrap_backdrop_site_validate() { // Define the selected conf path as soon as we have identified that // we have selected a Backdrop site. $drush_uri = $this->get_selected_uri(); $this->setup_server_globals($drush_uri); $conf_path = $this->conf_path($drush_uri); drush_set_context('DRUSH_SELECTED_BACKDROP_SITE_CONF_PATH', $conf_path); $conf_file = "{$conf_path}/settings.php"; if (!file_exists($conf_file)) { return drush_bootstrap_error('DRUPAL_SITE_SETTINGS_NOT_FOUND', dt("Could not find a Backdrop settings.php file at !file.", array('!file' => $conf_file))); } drush_bootstrap_value('site', $_SERVER['HTTP_HOST']); drush_bootstrap_value('conf_path', $conf_path); return TRUE; }
/** * Validate the DRUSH_BOOTSTRAP_DRUPAL_DATABASE phase * * Attempt to make a working database connection using the * database credentials that were loaded during the previous * phase. */ function bootstrap_drupal_database_validate() { if (!drush_valid_db_credentials()) { return drush_bootstrap_error('DRUSH_DRUPAL_DB_ERROR'); } return TRUE; }