Commit 1c437d30 authored by Adrian Rossouw's avatar Adrian Rossouw

drumm's file branch code commit. checking it out and improving on it

parent 14a892bc
......@@ -6,7 +6,7 @@ function drush_db_pre_provision_backup($url = NULL) {
}
function drush_db_pre_provision_backup_rollback($url = NULL) {
provision_path("unlink", drush_get_option('sites_path') . "/$url/database.sql", TRUE, dt("Deleted mysql dump from sites directory"),
provision_service('file')->path("unlink", drush_get_option('sites_path') . "/$url/database.sql", TRUE, dt("Deleted mysql dump from sites directory"),
dt("Could not delete mysql dump from sites directory"));
}
......
......@@ -185,12 +185,12 @@ class provisionService_db extends provisionService {
$creds = $this->fetch_site_credentials();
$exists = provision_path("exists", $dump_file, TRUE,
$exists = provision_service('file')->path("exists", $dump_file, TRUE,
dt('Found database dump at @path.'),
dt('No database dump was found at @path.'),
'PROVISION_DB_DUMP_NOT_FOUND');
if ($exists) {
$readable = provision_path("readable", $dump_file, TRUE, dt('Database dump at @path is readable'),
$readable = provision_service('file')->path("readable", $dump_file, TRUE, dt('Database dump at @path is readable'),
dt('The database dump at @path could not be read.'),
'PROVISION_DB_DUMP_NOT_READABLE');
if ($readable) {
......
......@@ -17,7 +17,7 @@ function drush_db_provision_deploy_rollback($url = NULL) {
// 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($url) {
provision_path('unlink', drush_get_option('sites_path') .'/'. $url .'/database.sql', TRUE,
provision_service('file')->path('unlink', drush_get_option('sites_path') .'/'. $url .'/database.sql', TRUE,
dt("Removed dump file @path after restoring from it"),
dt("Could not remove dump file @path"), 'DRUSH_PERM_ERROR');
}
......@@ -30,7 +30,7 @@ function drush_db_pre_provision_restore_rollback($url = NULL) {
// 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($url = NULL) {
provision_path('unlink', drush_get_option('sites_path') . '/' . $url .'/database.sql', TRUE,
provision_service('file')->path('unlink', drush_get_option('sites_path') . '/' . $url .'/database.sql', TRUE,
dt("Removed dump file @path after restoring from it"),
dt("Could not remove dump file @path"), 'DRUSH_PERM_ERROR');
......
This diff is collapsed.
......@@ -26,7 +26,7 @@ function drush_provision_drupal_provision_backup_validate($url = NULL, $backup_f
}
if ($backup_file) {
if (provision_path("exists", $backup_file, FALSE,
if (provision_service('file')->path("exists", $backup_file, FALSE,
dt("Backing site up to @path."),
dt("Back up file @path already exists."),
'PROVISION_BACKUP_ALREADY_EXISTS')) {
......@@ -77,7 +77,7 @@ function drush_provision_drupal_provision_backup($url) {
function drush_provision_drupal_provision_backup_rollback() {
$backup_file = drush_get_option('backup_file');
if (file_exists($backup_file)) {
provision_path('unlink', $backup_file, TRUE,
provision_service('file')->path('unlink', $backup_file, TRUE,
dt("Removed stale backup file $backup_file"), dt("Failed deleting backup file $backup_file"));
}
}
......@@ -27,7 +27,7 @@ function drush_provision_drupal_pre_provision_clone($url, $new_url, $platform =
* Remove the extracted site directory
*/
function drush_provision_drupal_pre_provision_clone_rollback($url, $new_url, $platform = null) {
$success = provision_path("unlink", drush_get_option('backup_file'), TRUE, dt('Removed unused clone site package'), dt('Could not remove unused clone site package'));
$success = provision_service('file')->path("unlink", drush_get_option('backup_file'), TRUE, dt('Removed unused clone site package'), dt('Could not remove unused clone site package'));
}
/**
......
......@@ -21,7 +21,7 @@
function drush_provision_drupal_provision_deploy_validate($url = null, $backup_file = null) {
_provision_drupal_url_required();
$exists = provision_path("exists", $backup_file, TRUE,
$exists = provision_service('file')->path("exists", $backup_file, TRUE,
dt("Deploying site from @path"),
dt("Could not find backup file @path"),
'PROVISION_BACKUP_NOT_FOUND');
......@@ -36,7 +36,7 @@ function drush_provision_drupal_provision_deploy_validate($url = null, $backup_f
function drush_provision_drupal_pre_provision_deploy($url, $backup_file) {
// the url is likely to have changed in the deployment
drush_set_option('site_url', $url);
$extracted = provision_path("extract", drush_get_option('backup_file'), drush_get_option('sites_path') ."/$url",
$extracted = provision_service('file')->path("extract", drush_get_option('backup_file'), drush_get_option('sites_path') ."/$url",
dt('Successfully extracted the contents of @path'),
dt('Failed to extract the contents of @path'),
'PROVISION_BACKUP_EXTRACTION_FAILED');
......
......@@ -69,7 +69,7 @@ function drush_provision_drupal_provision_install_rollback($url) {
function drush_provision_drupal_post_provision_install($url) {
drush_set_option('aliases', drush_get_option('aliases'), 'site');
drush_set_option('installed', TRUE, 'site');
provision_path("chmod", "./sites/$url/settings.php", 0440, dt("Secured settings.php with safe permissions"));
provision_service('file')->path("chmod", "./sites/$url/settings.php", 0440, dt("Secured settings.php with safe permissions"));
_provision_drupal_rebuild_caches($url);
drush_set_option('packages', _scrub_object(provision_drupal_system_map()), 'site');
}
......
......@@ -49,7 +49,7 @@ function drush_provision_drupal_pre_provision_migrate_rollback($url, $platform =
drush_log(dt("Bringing site out of maintenance"));
drush_set_option('site_offline', 0);
_provision_drupal_create_settings_file($url);
$success = provision_path("unlink", drush_get_option('backup_file'), TRUE, dt('Removed unused migration site package'), dt('Could not remove unused migration site package'));
$success = provision_service('file')->path("unlink", drush_get_option('backup_file'), TRUE, dt('Removed unused migration site package'), dt('Could not remove unused migration site package'));
_provision_apache_create_vhost_config($url);
_provision_apache_restart_apache();
}
......
......@@ -194,23 +194,23 @@ function _provision_drupal_create_settings_file($url = NULL) {
$options['extra_config'] .= join("\n", drush_command_invoke_all('provision_drupal_config', $url, $options));
drush_log(dt("Generate settings.php file"));
if (provision_path("exists", "sites/$url/settings.php")) {
provision_path("chmod", "sites/$url/settings.php", 0640,
if (provision_service('file')->path("exists", "sites/$url/settings.php")) {
provision_service('file')->path("chmod", "sites/$url/settings.php", 0640,
dt('Changed permissions of settings.php to @confirm'),
dt('Could not change permissions of settings.php to @confirm'));
}
$fp = fopen("sites/$url/settings.php", "w");
$fp = provision_service('file')->path('fopen', 'sites/' . $url . '/settings.php', 'w');
$text = _provision_drupal_default_template();
fwrite($fp, "<?php\n". provision_render_config($text, $options));
fclose($fp);
# Change the permissions of the file
provision_path("chmod", "sites/$url/settings.php", 0440,
provision_service('file')->path("chmod", "sites/$url/settings.php", 0440,
dt('Changed permissions of settings.php to @confirm'),
dt('Could not change permissions of settings.php to @confirm'));
provision_path("chgrp", "sites/$url/settings.php", drush_get_option('web_group'),
provision_service('file')->path("chgrp", "sites/$url/settings.php", drush_get_option('web_group'),
dt('Change group ownership of settings.php to @confirm'),
dt('Could not change group ownership of settings.php to @confirm'));
}
......@@ -251,25 +251,25 @@ function _provision_drupal_create_directories($url, $profile = NULL) {
foreach ($mkdir as $path => $perm) {
if (!is_dir($path)) {
provision_path("mkdir", $path, TRUE,
provision_service('file')->path("mkdir", $path, TRUE,
dt("Created <code>@path</code>"),
dt("Could not create <code>@path</code>"),
'DRUSH_PERM_ERROR');
}
provision_path("chmod_recursive", $path, $perm,
provision_service('file')->path("chmod_recursive", $path, $perm,
dt("Changed permissions of <code>@path</code> to @confirm"),
dt("Could not change permissions <code>@path</code> to @confirm")
);
}
foreach ($chown as $path => $owner) {
provision_path("chown_recursive", $path, $owner,
provision_service('file')->path("chown_recursive", $path, $owner,
dt("Changed ownership of <code>@path</code>"),
dt("Could not change ownership <code>@path</code>"),
'DRUSH_PERM_ERROR' );
}
foreach ($chgrp as $path => $group) {
provision_path("chgrp_recursive", $path, $group,
provision_service('file')->path("chgrp_recursive", $path, $group,
dt("Changed group ownership of <code>@path</code>"),
dt("Could not change group ownership <code>@path</code>"));
}
......@@ -391,7 +391,7 @@ function _provision_drupal_maintain_aliases($url) {
}
foreach($aliases as $alias) {
if (trim($alias)) {
provision_path("symlink", $url, drush_get_option('docroot_path') . "/sites/" . $alias,
provision_service('file')->path("symlink", $url, drush_get_option('docroot_path') . "/sites/" . $alias,
dt("Created symlink for alias @alias", array("@alias" => $alias)),
dt("Could not create symlink for alias @alias", array("@alias" => $alias)));
}
......@@ -414,7 +414,7 @@ function _provision_drupal_delete_aliases($aliases, $silent = false) {
}
foreach ($aliases as $alias) {
if ($alias = trim($alias)) {
provision_path("unlink", drush_get_option('docroot_path') . "/sites/" . $alias, TRUE,
provision_service('file')->path("unlink", drush_get_option('docroot_path') . "/sites/" . $alias, TRUE,
dt("Removed symlink for alias @alias", array("@alias" => $alias)), $error);
}
}
......
......@@ -26,7 +26,7 @@
function drush_provision_drupal_provision_restore_validate($url = null, $restore_file = null) {
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE);
$exists = provision_path("exists", $restore_file, TRUE,
$exists = provision_service('file')->path("exists", $restore_file, TRUE,
dt("Restoring site from @path"),
dt("Could not find backup file @path"),
'PROVISION_BACKUP_NOT_FOUND');
......@@ -41,7 +41,7 @@ function drush_provision_drupal_provision_restore_validate($url = null, $restore
function drush_provision_drupal_pre_provision_restore($url, $restore_file) {
drush_invoke('provision-backup', $url);
provision_path("extract", drush_get_option('restore_file'), drush_get_option('sites_path') ."/$url.restore",
provision_service('file')->path("extract", drush_get_option('restore_file'), drush_get_option('sites_path') ."/$url.restore",
dt('Successfully extracted the contents of @path'),
dt('Failed to extract the contents of @path'),
'PROVISION_BACKUP_EXTRACTION_FAILED');
......@@ -60,7 +60,7 @@ function drush_provision_drupal_pre_provision_restore_rollback($url) {
function drush_provision_drupal_provision_restore($url) {
$old = drush_get_option('sites_path') ."/$url.restore";
$new = drush_get_option('sites_path') ."/$url";
provision_path("switch_paths", $old, $new ,
provision_service('file')->path("switch_paths", $old, $new ,
dt('Swapping out the @path and @confirm directories was successful.'),
dt('Swapping the @path and @confirm directories has failed.'),
'DRUSH_PERM_ERROR');
......
......@@ -25,20 +25,20 @@ function drush_provision_drupal_provision_verify_validate($url = null) {
*/
function drush_provision_drupal_provision_verify($url = null) {
if (PROVISION_CONTEXT_PLATFORM) {
_provision_create_dir(drush_get_option('config_path'), dt('Provision configuration'), 0711);
_provision_create_dir(drush_get_option('config_path') . '/includes', dt('Provision PHP configuration'), 0711);
if (!provision_path('exists', drush_get_option('config_path') . '/includes/global.inc', TRUE, dt("Global configuration file exists"))) {
provision_service('file')->create_dir(drush_get_option('config_path'), dt('Provision configuration'), 0711);
provision_service('file')->create_dir(drush_get_option('config_path') . '/includes', dt('Provision PHP configuration'), 0711);
if (!provision_service('file')->path('exists', drush_get_option('config_path') . '/includes/global.inc', TRUE, dt("Global configuration file exists"))) {
# create an empty global.inc so the include doesn't fail with
# open_basedir restrictions
if (!$file = fopen(drush_get_option('config_path') . '/includes/global.inc', 'a')) {
if (!$file = provision_service('file')->path('fopen', drush_get_option('config_path') . '/includes/global.inc', 'a')) {
drush_set_error('PROVISION_FRAMEWORK_ERROR', dt('Cannot create global settings configuration'));
} else {
fwrite($file, "<?php # global settings.php");
fclose($file);
}
}
_provision_create_dir(drush_get_option('backup_path'), dt('Backup'), 0700);
provision_path("writable", drush_get_option('sites_path'), TRUE, dt("Drupal sites directory is writable by the provisioning script"),
provision_service('file')->create_dir(drush_get_option('backup_path'), dt('Backup'), 0700);
provision_service('file')->path("writable", drush_get_option('sites_path'), TRUE, dt("Drupal sites directory is writable by the provisioning script"),
dt("Drupal sites directory is not writable by the provisioning script"), 'PROVISION_SITES_DIR_NOT_WRITABLE');
drush_set_option('sites', array_keys((array) provision_drupal_find_sites()), 'drupal');
......
......@@ -51,7 +51,6 @@ if ($name['name'] == 'root') {
* @{
*/
include_once('provision.inc');
include_once('provision.path.inc');
/**
* implementation of hook_drush_init().
......@@ -202,10 +201,10 @@ function drush_provision_hostmaster_make($platform) {
* Generate a provision.settings.php file to configure provision
*/
function _provision_generate_config() {
$exists = provision_path_exists(drush_get_option('docroot_path') . '/drushrc.php');
$exists = provision_service('file')->path('exists', drush_get_option('docroot_path') . '/drushrc.php');
if ($exists) {
drush_log(dt("Found existing drushrc.php file"));
provision_path("chmod", drush_get_option('docroot_path') . '/drushrc.php', 0600,
provision_service('file')->path("chmod", drush_get_option('docroot_path') . '/drushrc.php', 0600,
dt('Changed permissions of drushrc.php to @confirm'),
dt('Could not change permissions of drushrc.php to @confirm'));
}
......@@ -213,7 +212,7 @@ function _provision_generate_config() {
drush_log(dt("Generating drushrc.php file"));
}
provision_save_platform_data();
provision_path("chmod", drush_get_option('docroot_path') . '/drushrc.php', 0400,
provision_service('file')->path("chmod", drush_get_option('docroot_path') . '/drushrc.php', 0400,
dt('Changed permissions of drushrc.php to @confirm'),
dt('Could not change permissions of drushrc.php to @confirm'));
return TRUE;
......
......@@ -64,7 +64,7 @@ function provision_load_site_data($url) {
$conf_file = "sites/$url/site.php";
if (file_exists($conf_file)) {
provision_path('chmod', $conf_file, 0400);
provision_service('file')->path('chmod', $conf_file, 0400);
require($conf_file);
// The provision 0.1 config data might contain older data,
......@@ -88,21 +88,20 @@ function provision_save_site_data() {
// append the db settings in the _SERVER variable so normal drush commands can still read it.
$cache = drush_get_context($context);
$fp = fopen($filename, "a+");
$fp = provision_service('file')->path('fopen', $filename, 'a+');
$fields = array('db_type', 'db_host', 'db_user', 'db_passwd', 'db_name');
foreach ($fields as $key) {
$line = "\n\$_SERVER['$key'] = ". var_export($cache[$key], TRUE) .';';
fwrite($fp, $line);
}
fwrite($fp, "\n");
fclose($fp);
}
fwrite($fp, "\n");
fclose($fp);
}
provision_path("chmod", $filename, 0600,
provision_service('file')->path("chmod", $filename, 0600,
dt('Changed permissions of drushrc.php to @confirm'),
dt('Could not change permissions of drushrc.php to @confirm'));
}
/**
......@@ -133,7 +132,7 @@ function provision_render_config($template, $variables) {
drush_errors_off();
extract($variables, EXTR_SKIP); // Extract the variables to a local namespace
ob_start(); // Start output buffering
eval('?>'. $template); // Generate content
eval('?'.'>' . $template); // Generate content
$contents = ob_get_contents(); // Get the contents of the buffer
ob_end_clean(); // End buffering and discard
drush_errors_on();
......@@ -145,8 +144,8 @@ function provision_render_config($template, $variables) {
*
* @see provision_render_config()
*/
function provision_write_config($file, $template, $data) {
$file = fopen($file, "w");
function provision_write_config($drush_option, $file, $template, $data) {
$file = provision_service('file')->path('fopen', drush_get_option($drush_option) . '/' . $file, 'w');
$text = provision_render_config($template, $data);
fwrite($file, $text);
fclose($file);
......@@ -181,14 +180,14 @@ function _provision_recursive_delete($path) {
}
}
$rm = provision_path('rmdir', $path, TRUE,
$rm = provision_service('file')->path('rmdir', $path, TRUE,
dt('Deleting @path directory successful.', array('@path' => $path)),
dt('Deleting @path directory failed.', array('@path' => $path)));
$ret = $ret && $rm;
}
else {
$rm = provision_path('unlink', $path, TRUE, NULL,
$rm = provision_service('file')->path('unlink', $path, TRUE, NULL,
dt('Deleting @path file failed.', array('@path' => $path)));
$ret = $ret && $rm;
}
......
This diff is collapsed.
......@@ -24,12 +24,12 @@ function provision_ssl_provision_apache_vhost_config($url, $options) {
if ($options['ssl_redirect']) {
// That's pretty bad, but if we *don't* do that, the vhost is never updated after the first write
// XXX: we need a better way to identify if this is legit
provision_path('exists', drush_get_option('vhost_path') . '/' . $url . '_80', FALSE, NULL, dt("Overwriting existing vhost %url:80 with redirection", array('%url' => $url)));
provision_service('file')->path('exists', drush_get_option('vhost_path') . '/' . $url . '_80', FALSE, NULL, dt("Overwriting existing vhost %url:80 with redirection", array('%url' => $url)));
$newoptions = $options;
// in the redirection template, the ServerName is the first alias in the list
array_push($newoptions['aliases'], $options['site_url']);
$newoptions['site_port'] = 80;
provision_write_config(drush_get_option('vhost_path') . '/' . $url . '_80', _provision_apache_redirect_template(), $newoptions);
provision_write_config('vhost_path', $url . '_80', _provision_apache_redirect_template(), $newoptions);
}
return array("php_value session.cookie_secure 1", "SSLEngine On");
} else {
......@@ -44,6 +44,6 @@ function provision_ssl_provision_apache_vhost_config($url, $options) {
*/
function provision_ssl_provision_apache_delete_vhost($url, $options) {
if ($options['ssl'] && $options['ssl_redirect']) {
provision_path('unlink', drush_get_option('vhost_path') . '/' . $url . '_80', TRUE, NULL, dt("Failed deleting redirection vhost."));
provision_service('file')->path('unlink', drush_get_option('vhost_path') . '/' . $url . '_80', TRUE, NULL, dt("Failed deleting redirection vhost."));
}
}
......@@ -47,10 +47,12 @@ function provision_apache_drush_init() {
drush_set_default('script_user', get_current_user());
// Redirection urls
drush_set_default('master_url', $GLOBALS['base_url']);
$master_url = drush_get_option('master_url');
drush_set_default('web_disable_url', $master_url .'/hosting/disabled');
drush_set_default('web_maintenence_url', $master_url .'/hosting/maintenance');
if (isset($GLOBALS['base_url'])) {
drush_set_default('master_url', $GLOBALS['base_url']);
$master_url = drush_get_option('master_url');
drush_set_default('web_disable_url', $master_url .'/hosting/disabled');
drush_set_default('web_maintenence_url', $master_url .'/hosting/maintenance');
}
drush_set_default('web_ip', '127.0.0.1');
drush_set_default('web_port', 80);
......@@ -90,8 +92,8 @@ function _provision_apache_platform_template() {
*/
function _provision_apache_delete_vhost_config($url) {
// backward compatibility with 0.3
if (provision_path_exists(drush_get_option('vhost_path') .'/'. $url)) {
provision_path("unlink", drush_get_option('vhost_path') ."/" . $url, TRUE, dt("Removed apache virtual host configuration"));
if (provision_service('file')->path('exists', drush_get_option('vhost_path') .'/'. $url)) {
provision_service('file')->path("unlink", drush_get_option('vhost_path') ."/" . $url, TRUE, dt("Removed apache virtual host configuration"));
} else {
$options = drush_get_merged_options();
// backward compatibility with 0.3
......@@ -99,7 +101,7 @@ function _provision_apache_delete_vhost_config($url) {
$options['site_port'] = 80;
}
$file = $url . '_' . $options['site_port'];
provision_path("unlink", drush_get_option('vhost_path') ."/" . $file, TRUE, dt("Removed apache virtual host configuration"));
provision_service('file')->path("unlink", drush_get_option('vhost_path') ."/" . $file, TRUE, dt("Removed apache virtual host configuration"));
}
drush_command_invoke_all('provision_apache_delete_vhost', $url, $options);
}
......@@ -153,16 +155,16 @@ function _provision_apache_create_vhost_config($url, $template = NULL) {
*/
$file = $url . '_' . $options['site_port'];
// backward compatibility with 0.3
if (provision_path_exists(drush_get_option('vhost_path') .'/'. $url)) {
if (provision_service('file')->path('exists', drush_get_option('vhost_path') .'/'. $url)) {
rename(drush_get_option('vhost_path') .'/'. $url, drush_get_option('vhost_path') .'/'. $file);
}
drush_log(dt("Generating apache host configuration file %file.", array('%file' => $file)));
$writable = provision_path("writable", drush_get_option('vhost_path'), TRUE , NULL,
$writable = provision_service('file')->path("writable", drush_get_option('vhost_path'), TRUE , NULL,
dt("Virtual host configuration path @path is not writable."),
'PROVISION_VHOST_PATH_NOT_WRITABLE');
if ($writable) {
return provision_write_config(drush_get_option('vhost_path') .'/'. $file, $template, $options);
return provision_write_config('vhost_path', $file, $template, $options);
} else {
return $writable;
}
......@@ -184,7 +186,7 @@ function _provision_apache_create_platform_config($url) {
$data['extra_config'] .= join("\n", drush_command_invoke_all('provision_apache_dir_config', $data));
$file = 'platform_' . $options['platform'] . '.conf';
drush_log(dt("Generating apache platform configuration file %file.", array('%file' => $file)));
$writable = provision_path("writable", drush_get_option('platform_conf_path'), TRUE , NULL, dt("Platform configuration path @path is not writable."), 'PROVISION_VHOST_PATH_NOT_WRITABLE');
$writable = provision_service('file')->path("writable", drush_get_option('platform_conf_path'), TRUE , NULL, dt("Platform configuration path @path is not writable."), 'PROVISION_VHOST_PATH_NOT_WRITABLE');
if ($writable) {
// remove the old path first.
......@@ -192,7 +194,7 @@ function _provision_apache_create_platform_config($url) {
if (file_exists($oldfile) && is_writable($oldfile)) {
unlink($oldfile);
}
return provision_write_config(drush_get_option('platform_conf_path') . '/' . $file, _provision_apache_platform_template(), $data);
return provision_write_config('platform_conf_path', $file, _provision_apache_platform_template(), $data);
} else {
return $writable;
}
......@@ -216,8 +218,8 @@ function _provision_apache_create_server_config($url) {
$options['extra_config'] = "# Extra configuration from modules:\n";
$options['extra_config'] .= join("\n", drush_command_invoke_all('provision_apache_server_config', $url, $options));
drush_log(dt("Generating apache server configuration file %file.", array('%file' => $file)));
$writable = provision_path("writable", drush_get_option('config_path'), TRUE , NULL,
drush_log(dt("Generating apache server configuration file %file.", array('%file' => drush_get_option('config_path') . '/apache.conf')));
$writable = provision_service('file')->path("writable", drush_get_option('config_path'), TRUE , NULL,
dt("Virtual host configuration path @path is not writable."),
'PROVISION_VHOST_PATH_NOT_WRITABLE');
......@@ -227,7 +229,7 @@ function _provision_apache_create_server_config($url) {
if (file_exists($oldfile) && is_writable($oldfile)) {
unlink($oldfile);
}
return provision_write_config(drush_get_option('config_path') .'/apache.conf', $template, $options);
return provision_write_config('config_path', 'apache.conf', $template, $options);
} else {
return $writable;
}
......@@ -243,7 +245,7 @@ function _provision_apache_default_server_template() {
}
function _provision_apache_delete_platform_config($file) {
provision_path("unlink", drush_get_option('platform_conf_path') ."/" . $file, TRUE, dt("Removed apache platform vhost configuration"));
provision_service('file')->path("unlink", drush_get_option('platform_conf_path') ."/" . $file, TRUE, dt("Removed apache platform vhost configuration"));
}
......
......@@ -2,8 +2,8 @@
function drush_provision_apache_provision_verify($url = null) {
if (PROVISION_CONTEXT_PLATFORM) {
_provision_create_dir(drush_get_option('vhost_path'), dt("Virtual host configuration"), 0700);
_provision_create_dir(drush_get_option('platform_conf_path'), dt("Platforms configuration"), 0700);
provision_service('file')->create_dir(drush_get_option('vhost_path'), dt("Virtual host configuration"), 0700);
provision_service('file')->create_dir(drush_get_option('platform_conf_path'), dt("Platforms configuration"), 0700);
if (drush_get_option('platform', null)) {
_provision_apache_create_platform_config($url);
......
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