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:
parent
759a375f5e
commit
266cc76a03
|
|
@ -235,15 +235,21 @@ include "root.php";
|
||||||
|
|
||||||
function copy_scripts() {
|
function copy_scripts() {
|
||||||
$this->write_progress("Copying 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')){
|
if (file_exists('/usr/share/examples/fusionpbx/resources/install/scripts')){
|
||||||
$src_dir = '/usr/share/examples/fusionpbx/resources/install/scripts';
|
$src_dir = '/usr/share/examples/fusionpbx/resources/install/scripts';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/scripts';
|
$src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/scripts';
|
||||||
}
|
}
|
||||||
$dst_dir = $this->detect_switch->script_dir();
|
$dst_dir = $script_dir;
|
||||||
if (is_readable($this->detect_switch->script_dir())) {
|
if (is_readable($script_dir)) {
|
||||||
$this->recursive_copy($src_dir, $dst_dir, $_SESSION['scripts']['options']['text']);
|
$this->recursive_copy($src_dir, $dst_dir, $_SESSION['scripts']['options']['text']);
|
||||||
unset($src_dir, $dst_dir);
|
unset($src_dir, $dst_dir);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue