From 3c3f087bc9c720ffa3553cbe113620ca84d2fadb Mon Sep 17 00:00:00 2001 From: Richard Neese Date: Sat, 18 Oct 2014 20:55:42 +0000 Subject: [PATCH] fixing install.php with new layout for fhs com pliancy --- resources/classes/install.php | 50 ++++++++++++----------------------- resources/install.php | 38 +++++++++++++------------- 2 files changed, 36 insertions(+), 52 deletions(-) diff --git a/resources/classes/install.php b/resources/classes/install.php index addd482dd6..341e57469d 100644 --- a/resources/classes/install.php +++ b/resources/classes/install.php @@ -160,40 +160,24 @@ include "root.php"; } } - function copy_sounds() { - if (file_exists($this->switch_sounds_dir)) { - if (file_exists('/usr/share/examples/fusionpbx/resources/install/sounds/en/us/callie/custom/')){ - $src_dir = '/usr/share/fusionpbx/resources/install/sounds/en/us/callie/custom/'; + //function copy_sounds() { + // if (file_exists($this->switch_sounds_dir)) { + // if (file_exists('/usr/share/examples/fusionpbx/resources/install/sounds/en/us/callie/custom/')){ + // $src_dir = '/usr/share/fusionpbx/resources/install/sounds/en/us/callie/custom/'; // changes the output dir for testing - $dst_dir = $this->switch_sounds_dir.'/en/us/fusionpbx/custom/'; - } - else { - $src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/sounds/en/us/callie/custom/'; - $dst_dir = $this->switch_sounds_dir.'/en/us/callie/custom/'; - } - $this->recursive_copy($src_dir, $dst_dir, "-n"); - if (is_readable($this->switch_sounds_dir)) { - $this->recursive_copy($src_dir, $dst_dir); - chmod($dst_dir, 0664); - } - } - } - - function copy_swf() { - clearstatcache(); - if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/recordings')) { - $file = "slim.swf"; - $src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/htdocs'; - $dst_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/recordings'; - if (copy($src_dir.'/'.$file, $dst_dir.'/'.$file)) { - $this->result['copy']['swf'][] = "copied from ".$src_dir."/".$file." to ".$dst_dir."/".$file."
\n"; - } - else { - $this->result['copy']['swf'][] = "copy failed from ".$src_dir."/".$file." to ".$dst_dir."/".$file."
\n"; - } - } - } - + // $dst_dir = $this->switch_sounds_dir.'/en/us/fusionpbx/custom/'; + // } + // else { + // $src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/sounds/en/us/callie/custom/'; + // $dst_dir = $this->switch_sounds_dir.'/en/us/callie/custom/'; + // } + // $this->recursive_copy($src_dir, $dst_dir, "-n"); + // if (is_readable($this->switch_sounds_dir)) { + // $this->recursive_copy($src_dir, $dst_dir); + // chmod($dst_dir, 0664); + // } + // } + //} } //how to use the class diff --git a/resources/install.php b/resources/install.php index e44bde5998..2f5bf51f25 100644 --- a/resources/install.php +++ b/resources/install.php @@ -171,12 +171,12 @@ require_once "resources/functions.php"; $switch_dialplan_dir = $switch_conf_dir.'/dialplan'; } //old - elseif (file_exists('/etc/freeswitch/vars.xml')) { - $switch_conf_dir = '/etc/freeswitch'; - $switch_extensions_dir = $switch_conf_dir.'/directory'; - $switch_sip_profiles_dir = $switch_conf_dir.'/sip_profiles'; - $switch_dialplan_dir = $switch_conf_dir.'/dialplan'; - } + //if (file_exists('/etc/freeswitch/vars.xml')) { + // $switch_conf_dir = '/etc/freeswitch'; + // $switch_extensions_dir = $switch_conf_dir.'/directory'; + // $switch_sip_profiles_dir = $switch_conf_dir.'/sip_profiles'; + // $switch_dialplan_dir = $switch_conf_dir.'/dialplan'; + //} if (file_exists('/var/lib/freeswitch/db')) { $switch_db_dir = '/var/lib/freeswitch/db'; } @@ -191,35 +191,35 @@ require_once "resources/functions.php"; $switch_scripts_dir = '/var/lib/fusionpbx/scripts'; } //old - elseif (file_exists('/usr/share/freeswitch/scripts')) { - $switch_scripts_dir = '/usr/share/freeswitch/scripts'; - } + //if (file_exists('/usr/share/freeswitch/scripts')) { + // $switch_scripts_dir = '/usr/share/freeswitch/scripts'; + //} //new if (file_exists('/usr/share/freeswitch/grammar')) { $switch_grammar_dir = '/usr/share/freeswitch/grammar'; } //old - elseif (file_exists('/usr/share/freeswitch/grammar')) { - $switch_grammar_dir = '/usr/share/freeswitch/grammar'; - } + //if (file_exists('/usr/share/freeswitch/grammar')) { + // $switch_grammar_dir = '/usr/share/freeswitch/grammar'; + //} //new if (file_exists('/var/lib/fusionpbx/storage')) { $switch_storage_dir = '/var/lib/fusionpbx/storage'; $switch_voicemail_dir = $switch_storage_dir.'/voicemail'; } //old - elseif (file_exists('/var/lib/freeswitch/storage')) { - $switch_storage_dir = '/var/lib/freeswitch/storage'; - $switch_voicemail_dir = $switch_storage_dir.'/voicemail'; - } + //if (file_exists('/var/lib/freeswitch/storage')) { + // $switch_storage_dir = '/var/lib/freeswitch/storage'; + // $switch_voicemail_dir = $switch_storage_dir.'/voicemail'; + //} //new if (file_exists('/var/lib/fusionpbx/recordings')) { $switch_recordings_dir = '/var/lib/fusionpbx/recordings'; } //old - elseif (file_exists('/var/lib/freeswitch/recordings')) { - $switch_recordings_dir = '/var/lib/freeswitch/recordings'; - } + //if (file_exists('/var/lib/freeswitch/recordings')) { + // $switch_recordings_dir = '/var/lib/freeswitch/recordings'; + //} if (file_exists('/usr/share/freeswitch/sounds')) { $switch_sounds_dir = '/usr/share/freeswitch/sounds'; }