unlink(drush_get_option('backup_file')) ->succeed('Removed unused clone site package') ->fail('Could not remove unused clone site package'); } /** * Switch the clone directories around now that we have the new db installed */ 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_uri, '@'); $hash_name = drush_get_option('#name') ? '#name' : 'name'; $options[$hash_name] = $new_uri; $options['platform'] = (isset($platform)) ? $platform : $options['platform']; $options['root'] = d($options['platform'])->root; $options['aliases'] = array(); $options['redirection'] = 0; // XXX: right now we just drop SSL configuration when cloning, because // we do not check if the site name change is compatible with the // certificate. This can be removed when we a) check for wildcard // certs and b) allow the user to change the cert from the UI. $options['ssl_enabled'] = 0; unset($options['ssl_key']); if ($profile = drush_get_option('profile', FALSE)) { $options['profile'] = $profile; } if ($db_server = drush_get_option('new_db_server', FALSE)) { $options['db_server'] = $db_server; } drush_invoke_process('@none', '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_uri, 'provision-deploy', array(drush_get_option('backup_file')), array('old_uri' => d()->uri)); if (!drush_get_error()) { provision_backend_invoke($new_uri, 'provision-verify'); } }