|
@@ -33,7 +33,9 @@ if (!class_exists('install')) {
|
|
public function config() {
|
|
public function config() {
|
|
|
|
|
|
//set the default config file location
|
|
//set the default config file location
|
|
- if (stristr(PHP_OS, 'BSD')) {
|
|
|
|
|
|
+ $os = strtoupper(substr(PHP_OS, 0, 3));
|
|
|
|
+ switch ($os) {
|
|
|
|
+ case "BSD":
|
|
$config_path = '/usr/local/etc/fusionpbx';
|
|
$config_path = '/usr/local/etc/fusionpbx';
|
|
$config_file = $config_path.'/config.conf';
|
|
$config_file = $config_path.'/config.conf';
|
|
$document_root = '/usr/local/www/fusionpbx';
|
|
$document_root = '/usr/local/www/fusionpbx';
|
|
@@ -45,8 +47,10 @@ if (!class_exists('install')) {
|
|
$storage_dir = '/var/lib/freeswitch/storage';
|
|
$storage_dir = '/var/lib/freeswitch/storage';
|
|
$voicemail_dir = '/var/lib/freeswitch/storage/voicemail';
|
|
$voicemail_dir = '/var/lib/freeswitch/storage/voicemail';
|
|
$scripts_dir = '/usr/share/freeswitch/scripts';
|
|
$scripts_dir = '/usr/share/freeswitch/scripts';
|
|
- }
|
|
|
|
- if (stristr(PHP_OS, 'Linux')) {
|
|
|
|
|
|
+ $php_dir = PHP_BINDIR;
|
|
|
|
+ $cache_location = '/var/cache/fusionpbx';
|
|
|
|
+ break;
|
|
|
|
+ case "LIN":
|
|
$config_path = '/etc/fusionpbx/';
|
|
$config_path = '/etc/fusionpbx/';
|
|
$config_file = $config_path.'/config.conf';
|
|
$config_file = $config_path.'/config.conf';
|
|
$document_root = '/var/www/fusionpbx';
|
|
$document_root = '/var/www/fusionpbx';
|
|
@@ -58,6 +62,25 @@ if (!class_exists('install')) {
|
|
$storage_dir = '/var/lib/freeswitch/storage';
|
|
$storage_dir = '/var/lib/freeswitch/storage';
|
|
$voicemail_dir = '/var/lib/freeswitch/storage/voicemail';
|
|
$voicemail_dir = '/var/lib/freeswitch/storage/voicemail';
|
|
$scripts_dir = '/usr/share/freeswitch/scripts';
|
|
$scripts_dir = '/usr/share/freeswitch/scripts';
|
|
|
|
+ $php_dir = PHP_BINDIR;
|
|
|
|
+ $cache_location = '/var/cache/fusionpbx';
|
|
|
|
+ break;
|
|
|
|
+ case "WIN":
|
|
|
|
+ $config_path = $_SERVER["DOCUMENT_ROOT"].DIRECTORY_SEPARATOR.'resources';
|
|
|
|
+ $config_file = $config_path.DIRECTORY_SEPARATOR.'config.conf';
|
|
|
|
+ $config_file = $config_path.DIRECTORY_SEPARATOR.'config.conf';
|
|
|
|
+ $document_root = $_SERVER["DOCUMENT_ROOT"];
|
|
|
|
+
|
|
|
|
+ $conf_dir = $_SERVER['ProgramFiles'].DIRECTORY_SEPARATOR.'freeswitch'.DIRECTORY_SEPARATOR.'conf';
|
|
|
|
+ $sounds_dir = $_SERVER['ProgramFiles'].DIRECTORY_SEPARATOR.'freeswitch'.DIRECTORY_SEPARATOR.'sounds';
|
|
|
|
+ $database_dir = $_SERVER['ProgramFiles'].DIRECTORY_SEPARATOR.'freeswitch'.DIRECTORY_SEPARATOR.'db';
|
|
|
|
+ $recordings_dir = $_SERVER['ProgramFiles'].DIRECTORY_SEPARATOR.'freeswitch'.DIRECTORY_SEPARATOR.'recordings';
|
|
|
|
+ $storage_dir = $_SERVER['ProgramFiles'].DIRECTORY_SEPARATOR.'freeswitch'.DIRECTORY_SEPARATOR.'storage';
|
|
|
|
+ $voicemail_dir = $_SERVER['ProgramFiles'].DIRECTORY_SEPARATOR.'freeswitch'.DIRECTORY_SEPARATOR.'voicemail';
|
|
|
|
+ $scripts_dir = $_SERVER['ProgramFiles'].DIRECTORY_SEPARATOR.'freeswitch'.DIRECTORY_SEPARATOR.'scripts';
|
|
|
|
+ $php_dir = dirname(PHP_BINARY);
|
|
|
|
+ $cache_location = dirname($_SERVER['DOCUMENT_ROOT']).DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'fusionpbx';
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
|
|
|
|
//end the script if the config path is not set
|
|
//end the script if the config path is not set
|
|
@@ -98,12 +121,12 @@ if (!class_exists('install')) {
|
|
$conf .= "document.root = ".$document_root."\n";
|
|
$conf .= "document.root = ".$document_root."\n";
|
|
$conf .= "project.path =\n";
|
|
$conf .= "project.path =\n";
|
|
$conf .= "temp.dir = /tmp\n";
|
|
$conf .= "temp.dir = /tmp\n";
|
|
- $conf .= "php.dir = ".PHP_BINDIR."\n";
|
|
|
|
|
|
+ $conf .= "php.dir = ".$php_dir."\n";
|
|
$conf .= "php.bin = php\n";
|
|
$conf .= "php.bin = php\n";
|
|
$conf .= "\n";
|
|
$conf .= "\n";
|
|
$conf .= "#cache settings\n";
|
|
$conf .= "#cache settings\n";
|
|
$conf .= "cache.method = file\n";
|
|
$conf .= "cache.method = file\n";
|
|
- $conf .= "cache.location = /var/cache/fusionpbx\n";
|
|
|
|
|
|
+ $conf .= "cache.location = ".$cache_location."\n";
|
|
$conf .= "cache.settings = true\n";
|
|
$conf .= "cache.settings = true\n";
|
|
$conf .= "\n";
|
|
$conf .= "\n";
|
|
$conf .= "#switch settings\n";
|
|
$conf .= "#switch settings\n";
|