Skip to content

Commit

Permalink
Refactor bootstrap_drupal_site_validate() into bootstrap_drupal_site_…
Browse files Browse the repository at this point in the history
…setup_server_global() and bootstrap_drupal_site_validate_settings_present().
  • Loading branch information
greg-1-anderson committed Mar 31, 2015
1 parent d483730 commit 1fdefbd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/Drush/Boot/DrupalBoot.php
Expand Up @@ -308,6 +308,15 @@ function bootstrap_drupal_site_validate() {
$drush_uri = _drush_bootstrap_selected_uri();
drush_set_context('DRUSH_SELECTED_DRUPAL_SITE_CONF_PATH', drush_conf_path($drush_uri));

$this->bootstrap_drupal_site_setup_server_global($drush_uri);
return $this->bootstrap_drupal_site_validate_settings_present();
}

/**
* Set up the $_SERVER globals so that Drupal will see the same values
* that it does when serving pages via the web server.
*/
function bootstrap_drupal_site_setup_server_global($drush_uri) {
// Fake the necessary HTTP headers that Drupal needs:
if ($drush_uri) {
$drupal_base_url = parse_url($drush_uri);
Expand Down Expand Up @@ -354,7 +363,13 @@ function bootstrap_drupal_site_validate() {
$_SERVER['SERVER_SOFTWARE'] = NULL;
$_SERVER['HTTP_USER_AGENT'] = NULL;
$_SERVER['SCRIPT_FILENAME'] = DRUPAL_ROOT . '/index.php';
}

/**
* Validate that the Drupal site has all of the settings that it
* needs to operated.
*/
function bootstrap_drupal_site_validate_settings_present() {
$site = drush_bootstrap_value('site', $_SERVER['HTTP_HOST']);

$conf_path = drush_bootstrap_value('conf_path', conf_path(TRUE, TRUE));
Expand Down

0 comments on commit 1fdefbd

Please sign in to comment.