]> _ Git - cubist_util.git/commitdiff
wip #6237 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 1 Sep 2023 17:26:54 +0000 (19:26 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 1 Sep 2023 17:26:54 +0000 (19:26 +0200)
src/Files/Files.php
src/Files/VirtualDirectory.php

index b7bdc307f7144fd8227f640c953d1c296dfacf2b..21f013659a748414e7cd46f7e172e3114628eb72 100644 (file)
@@ -40,7 +40,9 @@ class Files
                     throw new \RuntimeException(sprintf('Directory "%s" was not created', $path));
                 }
             } catch (\Exception $e) {
-                throw new \RuntimeException(sprintf('Directory "%s" was not created. %s', $path, $e->getMessage()));
+                if(!file_exists($path)) {
+                    throw new \RuntimeException(sprintf('Directory "%s" was not created. %s', $path, $e->getMessage()));
+                }
             }
         }
         return realpath($path) . '/';
index 772eac31ac72fe8942fe9d0e856a4b88b67974fd..c1e8db223e7b1e5b53f5ab7e0a638fa173877d7d 100644 (file)
@@ -23,9 +23,9 @@ class VirtualDirectory
         $this->_tmp = array();
     }
 
-    public function copy($from, $to, $prepend = false)
+    public function copy($from, $to, $prepend = false,$check=true)
     {
-        if (!file_exists($from)) {
+        if ($check && !file_exists($from)) {
             throw new \Exception(sprintf('File "%s" doesn\'t exist (to %s)', $from, $to));
         }
         $realto = $this->path($to);