Ignore visibility by default on copy/move in Filesystem #1724
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the current behavior, when creating a
Filesystem
instance with default visibility set (through passing the config); this will be enforced on anycopy
ormove
operation, where I would expect the default the be like the default adapter behavior (e.g. forAwsS3V3Adapter
: keep the current visibility). This is due to the forced config merge taking place e.g. here:flysystem/src/Filesystem.php
Line 122 in 532bb63
The following is a quick illustration of the somewhat confusing behavior:
I noticed this within the context of Laravel, which by default creates a
Filesystem
wrapper around any adapter before exposing it to the application; see also https://github.com/laravel/framework/blob/10.x/src/Illuminate/Filesystem/Filesystem.php.This is marked as draft as I'd like to have some input about possible approaches and wether or not this is something that is open for behavioral changes. Some ideas about this:
null
Config
class which unsets an option, which could be called here