Only overwrite lua scripts and add database_handle.lua as an exception.

This commit is contained in:
Mark Crane 2013-08-26 18:50:43 +00:00
parent 73375214cd
commit e7271794da
1 changed files with 28 additions and 2 deletions

View File

@ -53,8 +53,34 @@ include "root.php";
$this->recursive_copy($src.'/'.$file, $dst.'/'.$file);
}
else {
//echo "copy(".$src."/".$file.", ".$dst."/".$file.");<br />\n";
copy($src.'/'.$file, $dst.'/'.$file);
//show debug info
//echo "copy(".$src."/".$file.", ".$dst."/".$file.");<br />\n";
//check the file type by ext
if (substr($file, -3) == "lua") {
//set the exception default
$exception = false;
//set the exceptions
if ($file == "database_handle.lua") {
$exception = true;
}
//check for exceptions
if ($exception) {
//write over files
copy($src.'/'.$file, $dst.'/'.$file);
}
else {
//copy files that don't exist into the destination directory
if (!file_exists($dst.'/'.$file)) {
copy($src.'/'.$file, $dst.'/'.$file);
}
}
}
else {
//copy files that don't exist into the destination directory
if (!file_exists($dst.'/'.$file)) {
copy($src.'/'.$file, $dst.'/'.$file);
}
}
}
}
}