-
-
Notifications
You must be signed in to change notification settings - Fork 189
fix: Avoid manipulating config when resolving disks #901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This commit updates the storage integration such that it does not manipulate the filesystems config when a disk is resolved. This fixes an issue when using scoped disks where the disk's prefix property was injected into the parent disk's config, making the parent disk unusable from that point forward.
Seeing that the CI failed I now understand why the hack was added in the first place: The |
It would be nice if scoped disks will work correctly of course but we should also make sure that it works for all Laravel versions of course. So I'm happy to see if you can find a workable workaround to make this work for all supported versions. Edit: I marked it as draft for now, feel free to mark as ready whenever of course 👍 |
The only solutions I can think of are to copy the I'm not sure if there is any willingness to include either of those options. What do you think, @stayallive? |
Pushed a commit that should work with all Laravel versions without using reflection or copying code from the Laravel repository. Kudos to @grEvenX who came up with the solution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a sensible change to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the time to make the PR 👍
This commit updates the storage integration such that it does not manipulate the filesystems config when a disk is resolved.
Doing so fixes an issue when using scoped disks where the disk's prefix property is injected into the parent disk's config, making the parent disk unusable from that point forward.
The added test doesn't replicate the issue with scoped disks specifically because the
league/flysystem-path-prefixing
package is required to use scoped disks. The best I could do was to assert that the config isn't being manipulated when a disk is resolved, which seems sensible in and of itself.Tagging you here, @spawnia, as you may have some insight into why the "hack" this commit removes was added in the first place, and if it's still needed (ref #726).