]> granicus.if.org Git - php/commitdiff
Fixed a few warnings from copy():
authorKalle Sommer Nielsen <kalle@php.net>
Wed, 1 Apr 2009 09:20:35 +0000 (09:20 +0000)
committerKalle Sommer Nielsen <kalle@php.net>
Wed, 1 Apr 2009 09:20:35 +0000 (09:20 +0000)
* 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

win32/build/mkdist.php

index 5d254255937842c7e3fabb113bd4ee03ea5d75bc..1ec7c679ae5c585e5869a884f218fe82963184e4 100644 (file)
@@ -112,6 +112,13 @@ function copy_file_list($source_dir, $dest_dir, $list)
        global $is_debug, $dist_dir;
 
        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";
                copy($source_dir . DIRECTORY_SEPARATOR . $item, $dest_dir . DIRECTORY_SEPARATOR . $item);
                if ($is_debug) {