]> _ Git - cubist_util.git/commitdiff
wip #6765 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 4 Mar 2024 13:26:10 +0000 (14:26 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 4 Mar 2024 13:26:10 +0000 (14:26 +0100)
src/Files/VirtualDirectory.php

index 0bf66221afad5befd0da1dae49a9810cc4e8910c..ae9a822257b834fb70d3a7e077505591f2364011 100644 (file)
@@ -72,11 +72,15 @@ class VirtualDirectory
         return $this;
     }
 
-    public function copyDirectory($from, $to)
+    public function copyDirectory($from, $to, $throwExceptionOnError = true)
     {
         if (!file_exists($from)) {
-            $this->throwError(sprintf('Directory %s doen\'t exist', $from));
-            return $this;
+            if ($throwExceptionOnError) {
+                $this->throwError(sprintf('Directory %s doen\'t exist', $from));
+                return $this;
+            } else {
+                Files::mkdir($from);
+            }
         }
         $this->_directories[$this->path($to)] = $from;
         return $this;