]> _ Git - cubist_util.git/commitdiff
wip #4697
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 23 Sep 2021 17:51:05 +0000 (19:51 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 23 Sep 2021 17:51:05 +0000 (19:51 +0200)
src/Files/VirtualDirectory.php

index 828b0fb0bc01ff49cfa26c1f70a7bec24d54b088..918ccb3863b02680c51bcaf4a8ce0d7a3e072af7 100644 (file)
@@ -26,7 +26,7 @@ class VirtualDirectory
     public function copy($from, $to)
     {
         if (!file_exists($from)) {
-            throw new \Exception(sprintf('File %s doesn\'t exist', $from));
+            throw new \Exception(sprintf('File %s doesn\'t exist (to %s)', $from, $to));
         }
         $realto = $this->path($to);
         if (!$realto) {
@@ -118,6 +118,9 @@ class VirtualDirectory
             }
             $path = $file->getRealPath();
             $dest = str_replace($from, '', $path);
+            if(!$path){
+                continue;
+            }
             $this->copy($path, $this->relativePath($to) . '/' . ltrim($dest, '/'));
         }
     }