Commit 4f3de667 authored by Adrian Rossouw's avatar Adrian Rossouw Committed by adrian

Abstracted the functionality to prepare the $_SERVER variable into...

Abstracted the functionality to prepare the $_SERVER variable into provision_prepare_environment() and additionally fix migrations
parent 1e47bc07
......@@ -86,6 +86,7 @@ function drush_provision_drupal_provision_deploy($url) {
function drush_provision_drupal_post_provision_deploy($url) {
provision_prepare_environment();
_provision_drupal_create_settings_file($url);
// call the drush updatedb command.
drush_backend_invoke("updatedb", array('uri' => "http://$url"));
......
......@@ -39,10 +39,7 @@ function drush_provision_drupal_pre_provision_install($url) {
*/
function drush_provision_drupal_provision_install($url) {
// Requires at least the database settings to complete.
$fields = array('db_type', 'db_host', 'db_user', 'db_passwd', 'db_name');
foreach ($fields as $key) {
$_SERVER[$key] = drush_get_option($key, null, 'site');
}
provision_prepare_environment();
_provision_drupal_create_settings_file($url);
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE);
......
......@@ -577,3 +577,12 @@ function provision_parse_info_file($filename) {
return $info + $defaults;
}
/**
* Set up the $_SERVER environment variable so that drupal can correctly parse the settings.php file
*/
function provision_prepare_environment() {
$fields = array('db_type', 'db_host', 'db_user', 'db_passwd', 'db_name');
foreach ($fields as $key) {
$_SERVER[$key] = drush_get_option($key, null, 'site');
}
}
......@@ -7,11 +7,8 @@
*/
function drush_provision_drupal_provision_verify_validate($url = null) {
if ($url) {
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE);
$fields = array('db_type', 'db_host', 'db_user', 'db_passwd', 'db_name');
foreach ($fields as $key) {
$_SERVER[$key] = drush_get_option($key, null, 'site');
}
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE);
provision_prepare_environment();
_provision_drupal_create_settings_file($url);
drush_errors_on();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment