diff --git a/core/install/resources/classes/install.php b/core/install/resources/classes/install.php index 2bece2f5a6..90a50ee26e 100644 --- a/core/install/resources/classes/install.php +++ b/core/install/resources/classes/install.php @@ -33,7 +33,9 @@ if (!class_exists('install')) { public function config() { //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_file = $config_path.'/config.conf'; $document_root = '/usr/local/www/fusionpbx'; @@ -45,8 +47,10 @@ if (!class_exists('install')) { $storage_dir = '/var/lib/freeswitch/storage'; $voicemail_dir = '/var/lib/freeswitch/storage/voicemail'; $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_file = $config_path.'/config.conf'; $document_root = '/var/www/fusionpbx'; @@ -58,6 +62,25 @@ if (!class_exists('install')) { $storage_dir = '/var/lib/freeswitch/storage'; $voicemail_dir = '/var/lib/freeswitch/storage/voicemail'; $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 @@ -98,12 +121,12 @@ if (!class_exists('install')) { $conf .= "document.root = ".$document_root."\n"; $conf .= "project.path =\n"; $conf .= "temp.dir = /tmp\n"; - $conf .= "php.dir = ".PHP_BINDIR."\n"; + $conf .= "php.dir = ".$php_dir."\n"; $conf .= "php.bin = php\n"; $conf .= "\n"; $conf .= "#cache settings\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 .= "\n"; $conf .= "#switch settings\n";