Commit 43280580 authored by ergonlogic's avatar ergonlogic

Move Hosting feature check from hosting to provision.

parent 4f11e692
......@@ -86,7 +86,7 @@ if ($this->redirection || $ssl_redirection) {
<?php
$if_subsite = $this->data['http_subdird_path'] . '/' . $this->uri;
if (hosting_feature_enabled('subdirs') && provision_file()->exists($if_subsite)->status()) {
if (provision_hosting_feature_enabled('subdirs') && provision_file()->exists($if_subsite)->status()) {
print " Include " . $if_subsite . "/*.conf\n";
}
?>
......
......@@ -68,7 +68,7 @@ else {
print " include " . $server->include_path . "/nginx_vhost_common.conf;\n";
}
$if_subsite = $this->data['http_subdird_path'] . '/' . $this->uri;
if (hosting_feature_enabled('subdirs') && provision_file()->exists($if_subsite)->status()) {
if (provision_hosting_feature_enabled('subdirs') && provision_file()->exists($if_subsite)->status()) {
print " include " . $if_subsite . "/*.conf;\n";
}
?>
......
......@@ -17,7 +17,7 @@ class Provision_Service_http_apache extends Provision_Service_http_public {
$this->configs['server'][] = 'Provision_Config_Apache_Server';
$this->configs['platform'][] = 'Provision_Config_Apache_Platform';
$this->configs['site'][] = 'Provision_Config_Apache_Site';
if (hosting_feature_enabled('subdirs')) {
if (provision_hosting_feature_enabled('subdirs')) {
$this->configs['site'][] = 'Provision_Config_Apache_Subdir';
$this->configs['site'][] = 'Provision_Config_Apache_SubdirVhost';
}
......
......@@ -22,7 +22,7 @@ class Provision_Service_http_nginx extends Provision_Service_http_public {
$this->server->setProperty('nginx_has_gzip', FALSE);
$this->server->setProperty('provision_db_cloaking', TRUE);
$this->server->setProperty('phpfpm_mode', 'port');
if (hosting_feature_enabled('subdirs')) {
if (provision_hosting_feature_enabled('subdirs')) {
$this->configs['site'][] = 'Provision_Config_Nginx_Subdir';
$this->configs['site'][] = 'Provision_Config_Nginx_SubdirVhost';
}
......
......@@ -445,3 +445,12 @@ function provision_load_critical($load = NULL, $threshold = NULL) {
}
return ($load[0] > $threshold);
}
/**
* Check whether a Hosting feature is enabled.
*/
function provision_hosting_feature_enabled($feature) {
$features = drush_get_option('hosting_features', array());
return array_key_exists($feature, $features) && $features[$feature];
}
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