-
Notifications
You must be signed in to change notification settings - Fork 11k
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
[6.x] Fix the Filesystem manager's exception on unsupported driver #30331
[6.x] Fix the Filesystem manager's exception on unsupported driver #30331
Conversation
Neat 👍 |
@driesvints Done 👍 |
Note: Failed test not related Hi @driesvints, i was wondering how to mock the config repository so i check the other tests. I found that the UPDATE |
@arcanedev-maroc think the tests are definitely related and that the problem is just that you need to rewrite this line: $app['config'] = ['filesystems.disks.unsupported-disk' => null]; to this? $app['config'] = ['filesystems.disks' => []]; |
@driesvints How about this change ? |
Interesting, something changed in arrays for PHP 7.4 🤔 Update: @driesvints Try this in PHP 7.3 and 7.4 👀 $config = null;
dd($config['name']); |
Related RFC about the null-array change |
Is this ready to merge? I don't know if the previous comments are saying there is a problem or what? |
@taylorotwell I just checked and I think this merge should be reverted, this changes the driver resolution. When a disk named local have no driver it thrown an exception in the previous version (through multiple levels of non-existing array keys). With this merge it will resolve to local driver. I think the correct solution would be to check against the existence of the driver field and throw an exception with Also it will try to create drivers for non existing disks: if filesystems.php has no disk named local the |
This will fix the exception message on unsupported driver.
For example
Storage::disk('unsupported-disk')
;Before
Driver [] is not supported.
After
Driver [unsupported-disk] is not supported.