Update the provision class to change the switch statement to the if/elseif/else to again fix a problem iwth php fpm on Ubuntu 14.04 LTS

This commit is contained in:
Mark Crane 2014-09-29 08:05:10 +00:00
parent f00814b1b1
commit 8dbf61f46e
1 changed files with 5 additions and 10 deletions

View File

@ -38,8 +38,7 @@ include "root.php";
global $db; global $db;
$this->db = $db; $this->db = $db;
//set the default template directory //set the default template directory
switch (PHP_OS) { if (PHP_OS == "Linux") {
case "Linux":
//set the default template dir //set the default template dir
if (strlen($this->template_dir) == 0) { if (strlen($this->template_dir) == 0) {
if (file_exists('/etc/fusionpbx/resources/templates/provision')) { if (file_exists('/etc/fusionpbx/resources/templates/provision')) {
@ -49,8 +48,7 @@ include "root.php";
$this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision'; $this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision';
} }
} }
break; } elseif (PHP_OS == "FreeBSD") {
case "FreeBSD":
//if the FreeBSD port is installed use the following paths by default. //if the FreeBSD port is installed use the following paths by default.
if (file_exists('/usr/local/etc/fusionpbx/resources/templates/provision')) { if (file_exists('/usr/local/etc/fusionpbx/resources/templates/provision')) {
if (strlen($this->template_dir) == 0) { if (strlen($this->template_dir) == 0) {
@ -68,20 +66,17 @@ include "root.php";
$this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision'; $this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision';
} }
} }
break; } elseif (PHP_OS == "NetBSD") {
case "NetBSD":
//set the default template_dir //set the default template_dir
if (strlen($this->template_dir) == 0) { if (strlen($this->template_dir) == 0) {
$this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision'; $this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision';
} }
break; } elseif (PHP_OS == "OpenBSD") {
case "OpenBSD":
//set the default template_dir //set the default template_dir
if (strlen($this->template_dir) == 0) { if (strlen($this->template_dir) == 0) {
$this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision'; $this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision';
} }
break; } else {
default:
//set the default template_dir //set the default template_dir
if (strlen($this->template_dir) == 0) { if (strlen($this->template_dir) == 0) {
$this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision'; $this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision';