Commit 789911da authored by omega8cc's avatar omega8cc

Shorten and simplify the subdirs checks code.

parent 2e916fbd
......@@ -87,13 +87,7 @@ if ($this->redirection || $ssl_redirection) {
<?php
$if_subsite = $this->data['http_subdird_path'] . '/' . $this->uri;
$if_subdirs = drush_get_option('hosting_features', array());
if ((array_key_exists('subdirs', $if_subdirs) && $if_subdirs['subdirs'])) {
$subdirs_support = TRUE;
}
else {
$subdirs_support = FALSE;
}
if ($subdirs_support && provision_file()->exists($if_subsite)->status()) {
if (array_key_exists('subdirs', $if_subdirs) && $if_subdirs['subdirs'] && provision_file()->exists($if_subsite)->status()) {
print " Include " . $if_subsite . "/*.conf\n";
}
?>
......
......@@ -69,13 +69,7 @@ else {
}
$if_subsite = $this->data['http_subdird_path'] . '/' . $this->uri;
$if_subdirs = drush_get_option('hosting_features', array());
if ((array_key_exists('subdirs', $if_subdirs) && $if_subdirs['subdirs'])) {
$subdirs_support = TRUE;
}
else {
$subdirs_support = FALSE;
}
if ($subdirs_support && provision_file()->exists($if_subsite)->status()) {
if (array_key_exists('subdirs', $if_subdirs) && $if_subdirs['subdirs'] && provision_file()->exists($if_subsite)->status()) {
print " include " . $if_subsite . "/*.conf;\n";
}
?>
......
......@@ -18,13 +18,7 @@ class Provision_Service_http_apache extends Provision_Service_http_public {
$this->configs['platform'][] = 'Provision_Config_Apache_Platform';
$this->configs['site'][] = 'Provision_Config_Apache_Site';
$if_subdirs = drush_get_option('hosting_features', array());
if ((array_key_exists('subdirs', $if_subdirs) && $if_subdirs['subdirs'])) {
$subdirs_support = TRUE;
}
else {
$subdirs_support = FALSE;
}
if ($subdirs_support) {
if (array_key_exists('subdirs', $if_subdirs) && $if_subdirs['subdirs']) {
$this->configs['site'][] = 'Provision_Config_Apache_Subdir';
$this->configs['site'][] = 'Provision_Config_Apache_SubdirVhost';
}
......
......@@ -24,13 +24,7 @@ class Provision_Service_http_nginx extends Provision_Service_http_public {
$this->server->setProperty('phpfpm_mode', 'port');
$this->server->setProperty('subdirs_support', FALSE);
$if_subdirs = drush_get_option('hosting_features', array());
if ((array_key_exists('subdirs', $if_subdirs) && $if_subdirs['subdirs'])) {
$subdirs_support = TRUE;
}
else {
$subdirs_support = FALSE;
}
if ($subdirs_support) {
if (array_key_exists('subdirs', $if_subdirs) && $if_subdirs['subdirs']) {
$this->server->subdirs_support = TRUE;
$this->configs['site'][] = 'Provision_Config_Nginx_Subdir';
$this->configs['site'][] = 'Provision_Config_Nginx_SubdirVhost';
......@@ -84,13 +78,7 @@ class Provision_Service_http_nginx extends Provision_Service_http_public {
// Set correct subdirs_support value on server save
$if_subdirs = drush_get_option('hosting_features', array());
if ((array_key_exists('subdirs', $if_subdirs) && $if_subdirs['subdirs'])) {
$subdirs_support = TRUE;
}
else {
$subdirs_support = FALSE;
}
if ($subdirs_support) {
if (array_key_exists('subdirs', $if_subdirs) && $if_subdirs['subdirs']) {
$this->server->subdirs_support = TRUE;
}
}
......@@ -141,13 +129,7 @@ class Provision_Service_http_nginx extends Provision_Service_http_public {
// Set correct subdirs_support value on server verify
$if_subdirs = drush_get_option('hosting_features', array());
if ((array_key_exists('subdirs', $if_subdirs) && $if_subdirs['subdirs'])) {
$subdirs_support = TRUE;
}
else {
$subdirs_support = FALSE;
}
if ($subdirs_support) {
if (array_key_exists('subdirs', $if_subdirs) && $if_subdirs['subdirs']) {
$this->server->subdirs_support = TRUE;
}
......
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