Commit 07a8aa87 authored by drumm's avatar drumm Committed by Neil Drumm

Remove sites_path

parent a23f4e46
......@@ -6,7 +6,7 @@ function drush_db_pre_provision_backup() {
}
function drush_db_pre_provision_backup_rollback() {
provision_service('file')->unlink(drush_get_option('sites_path') . '/' . drush_get_option('uri') . '/database.sql')
provision_service('file')->unlink(d()->root . '/sites/' . d()->uri . '/database.sql')
->succeed('Deleted mysql dump from sites directory')
->fail('Could not delete mysql dump from sites directory');
}
......
......@@ -164,7 +164,7 @@ class provisionService_db extends provisionService {
function import_site_database() {
$dump_file = drush_get_option('sites_path') . '/' . drush_get_option('uri') . '/database.sql';
$dump_file = d()->root . '/sites/' . d()->uri . '/database.sql';
$creds = $this->fetch_site_credentials();
......
......@@ -17,7 +17,7 @@ function drush_db_provision_deploy_rollback() {
// Rollback doesn't apply here yet. Unless we trigger a deploy of the first dump
// made. Which could go on infinitely if something is really long.
function drush_db_post_provision_deploy() {
provision_service('file')->unlink(drush_get_option('sites_path') . '/' . drush_get_option('uri') . '/database.sql')
provision_service('file')->unlink(d()->root . '/sites/' . d()->uri . '/database.sql')
->succeed('Removed dump file @path after restoring from it')
->fail('Could not remove dump file @path', 'DRUSH_PERM_ERROR');
}
......@@ -30,7 +30,7 @@ function drush_db_pre_provision_restore_rollback() {
// Rollback doesn't apply here yet. Unless we trigger a restore of the first dump
// made. Which could go on infinitely if something is really long.
function drush_db_post_provision_restore() {
provision_service('file')->unlink(drush_get_option('sites_path') . '/' . drush_get_option('uri') . '/database.sql')
provision_service('file')->unlink(d()->root . '/sites/' . d()->uri . '/database.sql')
->succeed('Removed dump file @path after restoring from it')
->fail('Could not remove dump file @path', 'DRUSH_PERM_ERROR');
......
......@@ -57,7 +57,7 @@ function drush_provision_drupal_provision_backup() {
drush_log(dt("Adding sites directory to !backup_file", array('!backup_file' => $backup_file)), 'backup');
$olddir = getcwd();
// we need to do this because some retarded implementations of tar (e.g. SunOS) don't support -C
chdir(drush_get_option('sites_path') . '/' . drush_get_option('uri'));
chdir(d()->root . '/sites/' . d()->uri);
if (substr($backup_file, -2) == 'gz') {
// same as above: some do not support -z
$command = "tar cpf - . | gzip -c > %s";
......
......@@ -25,7 +25,7 @@ function drush_provision_drupal_pre_provision_delete($backup_file = NULL) {
*/
function drush_provision_drupal_provision_delete() {
if (PROVISION_CONTEXT_SITE) {
_provision_recursive_delete(drush_get_option('sites_path') . '/' . drush_get_option('uri'));
_provision_recursive_delete(d()->root . '/sites/' . d()->uri);
// we remove the aliases even if redirection is enabled as a precaution
// if redirection is enabled, keep silent about errors
_provision_drupal_delete_aliases(drush_get_option('aliases', array()), drush_get_option('redirection'));
......
......@@ -36,7 +36,7 @@ function drush_provision_drupal_provision_deploy_validate($backup_file = null) {
function drush_provision_drupal_pre_provision_deploy($backup_file) {
// the url is likely to have changed in the deployment
drush_set_option('site_url', drush_get_option('uri'));
$extracted = provision_service('file')->extract(drush_get_option('backup_file'), drush_get_option('sites_path') . '/' . drush_get_option('uri'))
$extracted = provision_service('file')->extract(drush_get_option('backup_file'), d()->root . '/sites/' . d()->uri)
->succeed('Successfully extracted the contents of @path')
->fail('Failed to extract the contents of @path', 'PROVISION_BACKUP_EXTRACTION_FAILED')
->status();
......
......@@ -74,7 +74,7 @@ function drush_provision_drupal_post_provision_migrate() {
// we remove the aliases even if redirection is enabled as a precaution
// if redirection is enabled, keep silent about errors
_provision_drupal_delete_aliases(drush_get_option('aliases', array()), drush_get_option('redirection'));
_provision_recursive_delete(drush_get_option('sites_path') . '/' . drush_get_option('uri'));
_provision_recursive_delete(d()->root . '/sites/' . d()->uri);
}
......@@ -209,7 +209,7 @@ class provisionConfig_drupal_settings extends provisionConfig {
protected $mode = 0440;
function filename() {
return $this->data['sites_path'] . '/' . $this->data['site_url'] . '/settings.php';
return $this->data['root'] . '/sites/' . $this->data['uri'] . '/settings.php';
}
function process() {
......
......@@ -41,7 +41,7 @@ function drush_provision_drupal_provision_restore_validate($restore_file = null)
function drush_provision_drupal_pre_provision_restore($restore_file) {
drush_invoke('provision-backup');
provision_service('file')->extract(drush_get_option('restore_file'), drush_get_option('sites_path') . '/' . drush_get_option('uri') . '.restore')
provision_service('file')->extract(drush_get_option('restore_file'), d()->root . '/sites/' . d()->uri . '.restore')
->succeed('Successfully extracted the contents of @path')
->fail('Failed to extract the contents of @path', 'PROVISION_BACKUP_EXTRACTION_FAILED');
}
......@@ -50,15 +50,15 @@ function drush_provision_drupal_pre_provision_restore($restore_file) {
* Remove the extracted site directory
*/
function drush_provision_drupal_pre_provision_restore_rollback() {
_provision_recursive_delete(drush_get_option('sites_path') . '/' . drush_get_option('uri') . '.restore');
_provision_recursive_delete(d()->root . '/sites/' . d()->uri . '.restore');
}
/**
* Switch the restore directories around now that we have the new db installed
*/
function drush_provision_drupal_provision_restore() {
$old = drush_get_option('sites_path') . '/' . drush_get_option('uri') . '.restore';
$new = drush_get_option('sites_path') . '/' . drush_get_option('uri');
$old = d()->root . '/sites/' . d()->uri . '.restore';
$new = d()->root . '/sites/' . d()->uri;
provision_service('file')->switch_paths($old, $new)
->succeed('Swapping out the @path1 and @path2 directories was successful.')
->fail('Swapping the @path1 and @path2 directories has failed.', 'DRUSH_PERM_ERROR');
......@@ -76,7 +76,7 @@ function drush_provision_drupal_provision_restore_rollback() {
* Delete the old site directory and recreate the settings file
*/
function drush_provision_drupal_post_provision_restore() {
_provision_recursive_delete(drush_get_option('sites_path') . '/' . drush_get_option('uri') . '.restore');
_provision_recursive_delete(d()->root . '/sites/' . d()->uri . '.restore');
// This is the actual drupal provisioning requirements.
_provision_drupal_create_directories();
_provision_drupal_create_settings_file();
......
......@@ -37,7 +37,7 @@ function drush_provision_drupal_provision_verify() {
provision_service('file')->create_dir(d()->backup_path, dt('Backup'), 0700);
}
elseif (PROVISION_CONTEXT_PLATFORM) {
provision_service('file')->writable(d()->sites_path)
provision_service('file')->writable(d()->root . '/sites')
->succeed('Drupal sites directory @path is writable by the provisioning script')
->fail('Drupal sites directory @path is not writable by the provisioning script', 'PROVISION_SITES_DIR_NOT_WRITABLE');
......
......@@ -297,9 +297,6 @@ class provisionPlatform extends provisionEnvironment {
$this->type = 'platform';
$this->setProperty('root', $_SERVER['PWD']);
// publish path can really be removed ...
$this->setProperty('sites_path', $this->root . '/sites');
$this->setProperty('server', '@server_localhost');
$this->is_oid('server');
......
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