From 0d3f032fdc061e911a820bc5d243fd66c1906aa7 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 4 Mar 2024 14:26:10 +0100 Subject: [PATCH] wip #6765 @0.25 --- src/Files/VirtualDirectory.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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; -- 2.39.5