diff --git a/platform/clone.provision.inc b/platform/clone.provision.inc index 115b743ef502ba44774c6f024d48eb5b08f4ac58..d03bf974c2c80ce9bd8d0abe3ffe0562a17e60aa 100644 --- a/platform/clone.provision.inc +++ b/platform/clone.provision.inc @@ -12,21 +12,21 @@ /** * Make sure we have a valid site being cloned, and that the file being cloned from exists */ -function drush_provision_drupal_provision_clone_validate($new_url = null, $platform = null) { +function drush_provision_drupal_provision_clone_validate($new_uri = null, $platform = null) { drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE); } /** * Make a backup before making any changes, and add extract the file we are restoring from */ -function drush_provision_drupal_pre_provision_clone($new_url, $platform = null) { +function drush_provision_drupal_pre_provision_clone($new_uri, $platform = null) { drush_invoke('provision-backup'); } /** * Remove the extracted site directory */ -function drush_provision_drupal_pre_provision_clone_rollback($new_url, $platform = null) { +function drush_provision_drupal_pre_provision_clone_rollback($new_uri, $platform = null) { $success = provision_file()->unlink(drush_get_option('backup_file')) ->succeed('Removed unused clone site package') ->fail('Could not remove unused clone site package'); @@ -35,18 +35,23 @@ function drush_provision_drupal_pre_provision_clone_rollback($new_url, $platform /** * Switch the clone directories around now that we have the new db installed */ -function drush_provision_drupal_provision_clone($new_url, $platform = null) { +function drush_provision_drupal_provision_clone($new_uri, $platform = null) { drush_set_option('old_platform', d()->platform->name); $options = d()->options; - $options['uri'] = ltrim($new_url, '@'); + $options['uri'] = ltrim($new_uri, '@'); + $options['name'] = $new_uri; $options['platform'] = (isset($platform)) ? $platform : $options['platform']; $options['aliases'] = array(); $options['redirection'] = 0; - drush_backend_invoke_args('provision-save', array($new_url), $options); + drush_backend_invoke_args('provision-save', array($new_uri), $options); # note that we reset the aliases so they don't conflict with the original site - provision_backend_invoke($new_url, 'provision-deploy', array(drush_get_option('backup_file'))); + provision_backend_invoke($new_uri, 'provision-deploy', array(drush_get_option('backup_file'))); + + if (!drush_get_error()) { + provision_backend_invoke($new_uri, 'provision-verify'); + } } diff --git a/platform/rename.provision.inc b/platform/rename.provision.inc deleted file mode 100644 index 55223ad59c2a9fa2d1045672454e35c97d2c216e..0000000000000000000000000000000000000000 --- a/platform/rename.provision.inc +++ /dev/null @@ -1,80 +0,0 @@ -unlink(drush_get_option('backup_file')) - ->succeed('Removed unused migration site package') - ->fail('Could not remove unused migration site package'); - d()->service('http')->create_site_config(); - d()->service('http')->parse_configs(); -} - -/** - * Switch the rename directories around now that we have the new db installed - */ -function drush_provision_drupal_provision_rename($new_url, $platform = null) { - drush_set_option('old_platform', d()->platform->name); - - $options = d()->options; - $options['uri'] = ltrim($new_url, '@'); - $options['platform'] = (isset($platform)) ? $platform : $options['platform']; - $options['aliases'] = array(); - $options['redirection'] = 0; - - drush_backend_invoke_args('provision-save', array($new_url), $options); - # note that we reset the aliases so they don't conflict with the original site - - provision_backend_invoke($new_url, 'provision-deploy', array(drush_get_option('backup_file'))); - if (!drush_get_error()) { - provision_backend_invoke($new_url, 'provision-verify'); - } -} - -function drush_provision_drupal_post_provision_rename($new_url) { - drush_set_option('installed', FALSE); - // we remove the aliases even if redirection is enabled as a precaution - // if redirection is enabled, keep silent about errors - _provision_drupal_delete_aliases(d()->aliases); - _provision_recursive_delete(d()->site_path); - d()->service('http')->sync(d()->site_path); - - // remove the existing alias - $config = new provisionConfig_drushrc_alias(d()->name); - $config->unlink(); - -}