Commit b2b3e748 authored by omega8cc's avatar omega8cc

Use $new_name instead of $new_uri to avoid confusion.

parent 1cb848cb
......@@ -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_uri = null, $platform = null) {
function drush_provision_drupal_provision_clone_validate($new_name = 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_uri, $platform = null) {
function drush_provision_drupal_pre_provision_clone($new_name, $platform = null) {
drush_invoke('provision-backup');
}
/**
* Remove the extracted site directory
*/
function drush_provision_drupal_pre_provision_clone_rollback($new_uri, $platform = null) {
function drush_provision_drupal_pre_provision_clone_rollback($new_name, $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,13 +35,13 @@ function drush_provision_drupal_pre_provision_clone_rollback($new_uri, $platform
/**
* Switch the clone directories around now that we have the new db installed
*/
function drush_provision_drupal_provision_clone($new_uri, $platform = null) {
function drush_provision_drupal_provision_clone($new_name, $platform = null) {
drush_set_option('old_platform', d()->platform->name);
$options = d()->options;
$options['uri'] = ltrim($new_uri, '@');
$options['uri'] = ltrim($new_name, '@');
$hash_name = drush_get_option('#name') ? '#name' : 'name';
$options[$hash_name] = $new_uri;
$options[$hash_name] = $new_name;
$options['platform'] = (isset($platform)) ? $platform : $options['platform'];
$options['root'] = d($options['platform'])->root;
$options['aliases'] = array();
......@@ -62,13 +62,13 @@ function drush_provision_drupal_provision_clone($new_uri, $platform = null) {
$options['db_server'] = $db_server;
}
drush_invoke_process('@none', 'provision-save', array($new_uri), $options);
drush_invoke_process('@none', 'provision-save', array($new_name), $options);
# note that we reset the aliases so they don't conflict with the original site
provision_backend_invoke($new_uri, 'provision-deploy', array(drush_get_option('backup_file')), array('old_uri' => d()->uri));
provision_backend_invoke($new_name, 'provision-deploy', array(drush_get_option('backup_file')), array('old_uri' => d()->uri));
if (!drush_get_error()) {
provision_backend_invoke($new_uri, 'provision-verify');
provision_backend_invoke($new_name, 'provision-verify');
}
provision_reload_config('site', d()->site_path . '/drushrc.php');
......
......@@ -18,7 +18,7 @@ function drush_provision_drupal_provision_migrate_validate($platform = NULL) {
*
* Implementation of drush_hook_pre_COMMAND().
*/
function drush_provision_drupal_pre_provision_migrate($platform, $new_uri = NULL) {
function drush_provision_drupal_pre_provision_migrate($platform, $new_name = NULL) {
/* Set offline mode to true and re-generate the settings.php. This will write a
* $conf['site_offline'] = 1; to the settings.php
*/
......@@ -31,8 +31,8 @@ function drush_provision_drupal_pre_provision_migrate($platform, $new_uri = NULL
drush_set_option('old_platform', d()->platform->name);
// If we are renaming the site, pick this up early.
if (!is_null($new_uri) && ($new_uri != d()->name)) {
drush_set_option('target_name', $new_uri);
if (!is_null($new_name) && ($new_name != d()->name)) {
drush_set_option('target_name', $new_name);
}
else {
// the site url stays the same
......@@ -53,7 +53,7 @@ function drush_provision_drupal_pre_provision_migrate($platform, $new_uri = NULL
*
* Implementation of drush_hook_pre_COMMAND_rollback().
*/
function drush_provision_drupal_pre_provision_migrate_rollback($platform, $new_uri = NULL) {
function drush_provision_drupal_pre_provision_migrate_rollback($platform, $new_name = NULL) {
// Set site_offline to false and regenerate the config
drush_log(dt("Bringing site out of maintenance"));
d()->site_enabled = true;
......@@ -73,7 +73,7 @@ function drush_provision_drupal_pre_provision_migrate_rollback($platform, $new_u
*
* Implementation of drush_hook_COMMAND().
*/
function drush_provision_drupal_provision_migrate($platform, $new_uri = NULL) {
function drush_provision_drupal_provision_migrate($platform, $new_name = NULL) {
$target = drush_get_option('target_name');
......@@ -81,11 +81,11 @@ function drush_provision_drupal_provision_migrate($platform, $new_uri = NULL) {
$options['uri'] = d()->uri;
if (!is_null($new_uri) && ($new_uri != d()->name)) {
if (!is_null($new_name) && ($new_name != d()->name)) {
$options = d()->options;
$options['uri'] = ltrim($new_uri, '@');
$options['uri'] = ltrim($new_name, '@');
$hash_name = drush_get_option('#name') ? '#name' : 'name';
$options[$hash_name] = $new_uri;
$options[$hash_name] = $new_name;
}
$options['platform'] = $platform;
$options['root'] = d($platform)->root;
......@@ -124,7 +124,7 @@ function drush_provision_drupal_provision_migrate_rollback($platform) {
*
* Implementation of drush_hook_post_COMMAND().
*/
function drush_provision_drupal_post_provision_migrate($platform, $new_uri = NULL) {
function drush_provision_drupal_post_provision_migrate($platform, $new_name = NULL) {
drush_set_option('installed', FALSE);
if (!drush_get_option('deploy_replace_site', FALSE)) {
......@@ -137,7 +137,7 @@ function drush_provision_drupal_post_provision_migrate($platform, $new_uri = NUL
if (!is_null($new_uri) && ($new_uri != d()->name)) {
if (!is_null($new_name) && ($new_name != d()->name)) {
// remove the existing alias
$config = new Provision_Config_Drushrc_Alias(d()->name);
$config->unlink();
......
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