Commit d8b4517c authored by mig5's avatar mig5 Committed by mig5

#826840 save settings.php in backups with uncloaked credentials so they can be...

#826840 save settings.php in backups with uncloaked credentials so they can be used on non-aegir hosts
parent 0896635d
......@@ -60,6 +60,19 @@ function drush_provision_drupal_provision_backup() {
// synch all filesystem changes back from the remote server.
d()->service('http')->fetch(d()->site_path . '/files/');
// Check if we are currently cloaking credentials
$cloaked = drush_get_option('provision_db_cloaking', TRUE);
if ($cloaked) {
drush_set_option('cloaking_off_temp', TRUE);
// Disable the cloaking of credentials temporarily
drush_log(dt("Temporarily uncloaking database credentials for backup"));
drush_set_option('provision_db_cloaking', FALSE);
// Write the uncloaked credentials to the settings.php
$olddir = getcwd();
// we need to do this because some retarded implementations of tar (e.g. SunOS) don't support -C
......@@ -75,6 +88,12 @@ function drush_provision_drupal_provision_backup() {
$result = drush_shell_exec($command, $backup_file);
if (drush_get_option('cloaking_off_temp', FALSE)) {
drush_log(dt("Re-cloaking database credentials after backup"));
drush_set_option('provision_db_cloaking', TRUE);
if (!$result && !drush_get_option('force', false)) {
drush_set_error('PROVISION_BACKUP_FAILED', dt("Could not back up sites directory for drupal"));
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