diff --git a/core/install/resources/classes/install.php b/core/install/resources/classes/install.php index 3aefbe2f76..4cfeffa651 100644 --- a/core/install/resources/classes/install.php +++ b/core/install/resources/classes/install.php @@ -1,9 +1,5 @@ Used to create the config.conf file.

+ *

BSD /usr/local/etc/fusionpbx

+ *

Linux /etc/fusionpbx

+ * @return boolean */ public function config() { @@ -70,6 +69,21 @@ if (!class_exists('install')) { $scripts_dir = '/usr/share/freeswitch/scripts'; } + //end the script if the config path is not set + if (!isset($config_path)) { + return false; + } + + //config directory is not writable + if (!is_writable($config_path)) { + return false; + } + + //make the config directory + if (isset($config_path)) { + system('mkdir -p '.$config_path); + } + //build the config file $conf = "\n"; $conf .= "#database system settings\n"; @@ -125,6 +139,14 @@ if (!class_exists('install')) { if(!$file_handle) { return; } fwrite($file_handle, $conf); fclose($file_handle); + + //if the config.conf file was saved return true + if (file_exists($config_file)) { + return true; + } + else { + return false; + } }