Commit b7c170b9 authored by anarcat's avatar anarcat Committed by anarcat

start work on #384972: create a basic apache configuration file on platform verification

parent 339db5a3
......@@ -61,6 +61,13 @@ function _provision_apache_redirect_template() {
return file_get_contents(dirname(__FILE__) ."/provision_apache_vhost_redirect.tpl.php");
}
/**
* The template for platform configuration settings
*/
function _provision_apache_platform_template() {
return file_get_contents(dirname(__FILE__) ."/provision_apache_platform.tpl.php");
}
/**
* Delete virtual host file
*/
......
<Directory <?php print $publish_path; ?>>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
......@@ -3,6 +3,18 @@
function provision_apache_provision_verify($url) {
if (PROVISION_CONTEXT_PLATFORM) {
_provision_create_dir(drush_get_option('vhost_path'), dt("Virtual host configuration"), 0700);
$data = drush_get_merged_options();
drush_log(dt("Generating platform apache configuration file"));
$writable = provision_path("writable", drush_get_option('vhost_path'), TRUE , NULL,
dt("Virtual host configuration path @path is not writable."),
'PROVISION_VHOST_PATH_NOT_WRITABLE');
$options = drush_get_context('options');
if ($writable) {
$file = fopen(drush_get_option('vhost_path') .'/_platform_' . $options['platform'] . '.conf', "w");
$text = provision_render_config(_provision_apache_platform_template(), $data);
fwrite($file, $text);
fclose($file);
}
}
else {
_provision_apache_create_vhost_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