Only overwrite lua scripts and add database_handle.lua as an exception.
This commit is contained in:
@@ -53,8 +53,34 @@ include "root.php";
|
|||||||
$this->recursive_copy($src.'/'.$file, $dst.'/'.$file);
|
$this->recursive_copy($src.'/'.$file, $dst.'/'.$file);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//echo "copy(".$src."/".$file.", ".$dst."/".$file.");<br />\n";
|
//show debug info
|
||||||
copy($src.'/'.$file, $dst.'/'.$file);
|
//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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user