From bfe557edc37cb916d0e3778887f874fbbd43d5d7 Mon Sep 17 00:00:00 2001
From: FusionPBX
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; + } }