Fixed a few warnings from copy():
* If $item is empty then skip to next entry, this fixes the "The first argument cannot be a directory" warnings
* If file does not exist then dont try to copy it
This commit is contained in:
Kalle Sommer Nielsen 2009-04-01 09:21:31 +00:00
parent 03243d7e17
commit e45c0bb900

View file

@ -112,6 +112,13 @@ function copy_file_list($source_dir, $dest_dir, $list)
global $is_debug, $dist_dir; global $is_debug, $dist_dir;
foreach ($list as $item) { foreach ($list as $item) {
if (empty($item)) {
continue;
} elseif (!is_file($source_dir . DIRECTORY_SEPARATOR . $item)) {
echo "WARNING: $item not found\n";
continue;
}
echo "Copying $item from $source_dir to $dest_dir\n"; echo "Copying $item from $source_dir to $dest_dir\n";
copy($source_dir . DIRECTORY_SEPARATOR . $item, $dest_dir . DIRECTORY_SEPARATOR . $item); copy($source_dir . DIRECTORY_SEPARATOR . $item, $dest_dir . DIRECTORY_SEPARATOR . $item);
if ($is_debug) { if ($is_debug) {