From 37d1942e53ecf95258138556a9c73891f59f503a Mon Sep 17 00:00:00 2001 From: Frank de Jonge Date: Sun, 7 Apr 2024 14:32:14 +0200 Subject: [PATCH] MountManager::copy forward all configuration options to write call. --- src/MountManager.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MountManager.php b/src/MountManager.php index 2ef2288ea..acab4a80a 100644 --- a/src/MountManager.php +++ b/src/MountManager.php @@ -7,6 +7,7 @@ use DateTimeInterface; use Throwable; +use function compact; use function method_exists; use function sprintf; @@ -396,10 +397,11 @@ private function copyAcrossFilesystem( try { if ($visibility == null && $retainVisibility) { $visibility = $sourceFilesystem->visibility($sourcePath); + $config = $config->extend(compact('visibility')); } $stream = $sourceFilesystem->readStream($sourcePath); - $destinationFilesystem->writeStream($destinationPath, $stream, $visibility ? compact(Config::OPTION_VISIBILITY) : []); + $destinationFilesystem->writeStream($destinationPath, $stream, $config->toArray()); } catch (UnableToRetrieveMetadata | UnableToReadFile | UnableToWriteFile $exception) { throw UnableToCopyFile::fromLocationTo($source, $destination, $exception); }