From: Vincent Vanwaelscappel Date: Thu, 23 Sep 2021 17:51:05 +0000 (+0200) Subject: wip #4697 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=e9de526eab75fd4ff218477966dbf813de96f42d;p=cubist_util.git wip #4697 --- diff --git a/src/Files/VirtualDirectory.php b/src/Files/VirtualDirectory.php index 828b0fb..918ccb3 100644 --- a/src/Files/VirtualDirectory.php +++ b/src/Files/VirtualDirectory.php @@ -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, '/')); } }