Only install class copy methods only add if the directory exists.

This commit is contained in:
Mark Crane
2014-02-13 00:23:00 +00:00
parent 60b7f7cb2a
commit abb1097e02
+10
View File
@@ -113,6 +113,7 @@ include "root.php";
function copy_conf() { function copy_conf() {
clearstatcache(); clearstatcache();
if (file_exists($this->switch_conf_dir)) {
$src_dir = $this->switch_conf_dir; $src_dir = $this->switch_conf_dir;
$dst_dir = $this->switch_conf_dir.'.orig'; $dst_dir = $this->switch_conf_dir.'.orig';
if ($src_dir != "/conf") { if ($src_dir != "/conf") {
@@ -134,9 +135,11 @@ include "root.php";
} }
} }
} }
}
function copy_scripts() { function copy_scripts() {
clearstatcache(); clearstatcache();
if (file_exists($this->switch_scripts_dir)) {
$src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/scripts'; $src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/scripts';
$dst_dir = $this->switch_scripts_dir; $dst_dir = $this->switch_scripts_dir;
if (is_readable($this->switch_scripts_dir)) { if (is_readable($this->switch_scripts_dir)) {
@@ -144,9 +147,11 @@ include "root.php";
unset($src_dir, $dst_dir); unset($src_dir, $dst_dir);
} }
} }
}
function copy_sounds() { function copy_sounds() {
clearstatcache(); clearstatcache();
if (file_exists($this->switch_sounds_dir)) {
$src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/sounds/en/us/callie/custom/8000'; $src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/sounds/en/us/callie/custom/8000';
$dst_dir = $this->switch_sounds_dir.'/en/us/callie/custom/8000'; $dst_dir = $this->switch_sounds_dir.'/en/us/callie/custom/8000';
if (is_readable($this->switch_sounds_dir)) { if (is_readable($this->switch_sounds_dir)) {
@@ -189,9 +194,11 @@ include "root.php";
} }
} }
} }
}
function copy_swf() { function copy_swf() {
clearstatcache(); clearstatcache();
if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/recordings')) {
$file = "slim.swf"; $file = "slim.swf";
$src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/htdocs'; $src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/htdocs';
$dst_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/recordings'; $dst_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/app/recordings';
@@ -202,15 +209,18 @@ include "root.php";
$this->result['copy']['swf'][] = "copy failed from ".$src_dir."/".$file." to ".$dst_dir."/".$file."<br />\n"; $this->result['copy']['swf'][] = "copy failed from ".$src_dir."/".$file." to ".$dst_dir."/".$file."<br />\n";
} }
} }
}
function copy_phrases() { function copy_phrases() {
clearstatcache(); clearstatcache();
if (file_exists($this->switch_conf_dir."/lang")) {
$src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/conf/lang"; $src_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/templates/conf/lang";
$dst_dir = $this->switch_conf_dir."/lang"; $dst_dir = $this->switch_conf_dir."/lang";
if (is_readable($this->switch_conf_dir)) { if (is_readable($this->switch_conf_dir)) {
$this->recursive_copy($src_dir, $dst_dir); $this->recursive_copy($src_dir, $dst_dir);
} }
} }
}
} }