add nginx and lighttpd support, refactor into common base class
This commit is contained in:
@@ -15,7 +15,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
class nginx {
|
||||
include('../classes/class.HttpConfigBase.php');
|
||||
|
||||
class nginx extends HttpConfigBase {
|
||||
private $logger = false;
|
||||
private $debugHandler = false;
|
||||
private $idnaConvert = false;
|
||||
@@ -187,7 +189,12 @@ class nginx {
|
||||
$this->nginx_data[$vhost_filename] .= "\t".'}'."\n";
|
||||
|
||||
if ($row_ipsandports['specialsettings'] != '') {
|
||||
$this->nginx_data[$vhost_filename].= $row_ipsandports['specialsettings'] . "\n";
|
||||
$this->nginx_data[$vhost_filename].= $this->processSpecialConfigTemplate(
|
||||
$row_ipsandports['specialsettings'],
|
||||
$row_ipsandports,
|
||||
array('domain'=> Settings::Get('system.hostname'),
|
||||
'loginname' => Settings::Get('phpfpm.vhost_httpuser'),
|
||||
'documentroot'=> $mypath)). "\n";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -363,7 +370,10 @@ class nginx {
|
||||
}
|
||||
|
||||
if ($ipandport['default_vhostconf_domain'] != '') {
|
||||
$_vhost_content .= $ipandport['default_vhostconf_domain'] . "\n";
|
||||
$_vhost_content .= $this->processSpecialConfigTemplate(
|
||||
$ipandport['default_vhostconf_domain'],
|
||||
$ipandport,
|
||||
$domain). "\n";
|
||||
}
|
||||
|
||||
$vhost_content.= "\t" . 'listen ' . $ipport . ($ssl_vhost == true ? ' ssl' : '') . ';' . "\n";
|
||||
@@ -425,7 +435,11 @@ class nginx {
|
||||
$vhost_content.= isset($this->needed_htpasswds[$domain['id']]) ? $this->needed_htpasswds[$domain['id']] . "\n" : '';
|
||||
|
||||
if ($domain['specialsettings'] != "") {
|
||||
$vhost_content = $this->mergeVhostCustom($vhost_content, $domain['specialsettings']);
|
||||
$vhost_content = $this->mergeVhostCustom($vhost_content, $this->processSpecialConfigTemplate(
|
||||
$domain['specialsettings'],
|
||||
$ipandport,
|
||||
$domain
|
||||
));
|
||||
}
|
||||
|
||||
if ($_vhost_content != '') {
|
||||
@@ -433,7 +447,11 @@ class nginx {
|
||||
}
|
||||
|
||||
if (Settings::Get('system.default_vhostconf') != '') {
|
||||
$vhost_content = $this->mergeVhostCustom($vhost_content, Settings::Get('system.default_vhostconf')."\n");
|
||||
$vhost_content = $this->mergeVhostCustom($vhost_content,
|
||||
$this->processSpecialConfigTemplate(
|
||||
Settings::Get('system.default_vhostconf'),
|
||||
$ipandport,
|
||||
$domain)."\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user