improved message related to config_lua
This commit is contained in:
@@ -77,6 +77,7 @@ include "root.php";
|
|||||||
else {
|
else {
|
||||||
$this->config_php = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/config.php";
|
$this->config_php = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/config.php";
|
||||||
}
|
}
|
||||||
|
$this->config_php = normalize_path_for_os($this->config_php);
|
||||||
}
|
}
|
||||||
|
|
||||||
function write_debug($message) {
|
function write_debug($message) {
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ include "root.php";
|
|||||||
protected $domain_uuid;
|
protected $domain_uuid;
|
||||||
protected $domain_name;
|
protected $domain_name;
|
||||||
protected $detect_switch;
|
protected $detect_switch;
|
||||||
|
protected $config_lua;
|
||||||
|
|
||||||
public $debug = false;
|
public $debug = false;
|
||||||
|
|
||||||
@@ -48,6 +49,15 @@ include "root.php";
|
|||||||
$this->domain_uuid = $domain_uuid;
|
$this->domain_uuid = $domain_uuid;
|
||||||
$this->domain = $domain_name;
|
$this->domain = $domain_name;
|
||||||
$this->detect_switch = $detect_switch;
|
$this->detect_switch = $detect_switch;
|
||||||
|
if (is_dir("/etc/fusionpbx")){
|
||||||
|
$config = "/etc/fusionpbx/config.lua";
|
||||||
|
} elseif (is_dir("/usr/local/etc/fusionpbx")){
|
||||||
|
$config = "/usr/local/etc/fusionpbx/config.lua";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$config = $_SESSION['switch']['scripts']['dir']."/resources/config.lua";
|
||||||
|
}
|
||||||
|
$this->config_lua = normalize_path_for_os($this->config_lua);
|
||||||
}
|
}
|
||||||
|
|
||||||
//utility Functions
|
//utility Functions
|
||||||
@@ -266,8 +276,8 @@ include "root.php";
|
|||||||
}
|
}
|
||||||
|
|
||||||
function create_config_lua() {
|
function create_config_lua() {
|
||||||
$this->write_progress("\Creating config.lua");
|
$this->write_progress("\tCreating " . $this->config_lua);
|
||||||
global $db;
|
global $db;
|
||||||
//get the odbc information
|
//get the odbc information
|
||||||
$sql = "select count(*) as num_rows from v_databases ";
|
$sql = "select count(*) as num_rows from v_databases ";
|
||||||
$sql .= "where database_driver = 'odbc' ";
|
$sql .= "where database_driver = 'odbc' ";
|
||||||
@@ -298,17 +308,9 @@ include "root.php";
|
|||||||
}
|
}
|
||||||
|
|
||||||
//config.lua
|
//config.lua
|
||||||
if (is_dir("/etc/fusionpbx")){
|
$fout = fopen($this->config_lua,"w");
|
||||||
$config = "/etc/fusionpbx/config.lua";
|
|
||||||
} elseif (is_dir("/usr/local/etc/fusionpbx")){
|
|
||||||
$config = "/usr/local/etc/fusionpbx/config.lua";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$config = $_SESSION['switch']['scripts']['dir']."/resources/config.lua";
|
|
||||||
}
|
|
||||||
$fout = fopen($config,"w");
|
|
||||||
if(!$fout){
|
if(!$fout){
|
||||||
throw new Exception("Failed to open '$config' for writing");
|
throw new Exception("Failed to open '{$this->config_lua}' for writing");
|
||||||
}
|
}
|
||||||
$tmp = "\n";
|
$tmp = "\n";
|
||||||
$tmp .= "--set the variables\n";
|
$tmp .= "--set the variables\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user