If the script dir is set in the session we know the location and don't need to ask freeswitch for it again.

This commit is contained in:
markjcrane 2015-11-25 18:16:38 -07:00
parent 759a375f5e
commit 266cc76a03
1 changed files with 9 additions and 3 deletions

View File

@ -235,15 +235,21 @@ include "root.php";
function copy_scripts() {
$this->write_progress("Copying Scripts");
if (file_exists($this->detect_switch->script_dir())) {
if (strlen($_SESSION['switch']['scripts']['dir']) > 0) {
$script_dir = $_SESSION['switch']['scripts']['dir'];
}
else {
$script_dir = $this->detect_switch->script_dir()
}
if (file_exists($script_dir())) {
if (file_exists('/usr/share/examples/fusionpbx/resources/install/scripts')){
$src_dir = '/usr/share/examples/fusionpbx/resources/install/scripts';
}
else {
$src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/scripts';
}
$dst_dir = $this->detect_switch->script_dir();
if (is_readable($this->detect_switch->script_dir())) {
$dst_dir = $script_dir;
if (is_readable($script_dir)) {
$this->recursive_copy($src_dir, $dst_dir, $_SESSION['scripts']['options']['text']);
unset($src_dir, $dst_dir);
}