Skip to content

Commit

Permalink
MountManager::copy forward all configuration options to write call.
Browse files Browse the repository at this point in the history
  • Loading branch information
frankdejonge committed Apr 7, 2024
1 parent 7d99ead commit 37d1942
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/MountManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use DateTimeInterface;
use Throwable;

use function compact;
use function method_exists;
use function sprintf;

Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 37d1942

Please sign in to comment.