From: Vincent Vanwaelscappel Date: Mon, 4 Mar 2024 13:26:10 +0000 (+0100) Subject: wip #6765 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=0d3f032fdc061e911a820bc5d243fd66c1906aa7;p=cubist_util.git wip #6765 @0.25 --- diff --git a/src/Files/VirtualDirectory.php b/src/Files/VirtualDirectory.php index 0bf6622..ae9a822 100644 --- a/src/Files/VirtualDirectory.php +++ b/src/Files/VirtualDirectory.php @@ -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;