BugFix-Add PROJECT_PATH for lua (#1740)

added project_path for lua to use where it needs to build urls
This commit is contained in:
Mafoo
2016-07-08 20:12:37 +01:00
committed by FusionPBX
parent cae644c8a1
commit 904a52434a
4 changed files with 21 additions and 3 deletions

View File

@@ -159,6 +159,14 @@ if (!class_exists('scripts')) {
//get the recordings directory
$recordings_dir = $_SESSION['switch']['recordings']['dir'];
//get the http_protocol
if (!isset($_SERVER['HTTP_PROTOCOL'])) {
$_SERVER['HTTP_PROTOCOL'] = 'http';
if (isset($_SERVER['REQUEST_SCHEME'])) { $_SERVER['HTTP_PROTOCOL'] = $_SERVER['REQUEST_SCHEME']; }
if ($_SERVER['HTTPS'] == 'on') { $_SERVER['HTTP_PROTOCOL'] = 'https'; }
if ($_SERVER['SERVER_PORT'] == '443') { $_SERVER['HTTP_PROTOCOL'] = 'https'; }
}
//find the location to write the config.lua
if (is_dir("/etc/fusionpbx")){
$config = "/etc/fusionpbx/config.lua";
@@ -205,6 +213,8 @@ if (!class_exists('scripts')) {
$tmp .= " php_bin = \"php5\";\n";
}
$tmp .= $this->correct_path(" document_root = [[".$_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."]];\n");
$tmp .= $this->correct_path(" project_path = [[".PROJECT_PATH."]];\n");
$tmp .= $this->correct_path(" http_protocol = [[".$_SERVER['HTTP_PROTOCOL'])."]];\n");
$tmp .= "\n";
$tmp .= "--store settings in memcache\n";