-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Implement DeferrableProvider #914
Conversation
$defer has been deprecated after laravel 5.8 (https://laravel.com/docs/5.8/upgrade#deferred-service-providers) and removed after laravel 6.x (laravel/framework#27505)
I see two issues with this:
You're referencing #773 => does that solution work you or why did you chose another approach? |
Does the console run all providers, or should we list the commands? Bumping to 5.8 is not a problem I guess. |
It's really a strange thing to me, I tried to make sense here 😄 Because the current ServiceProvider has a Interestingly, if one would not provide a And now since there is a
(I'm a bit confused because I thought "deferred" means only the So my TL;DR is (from observation, not understanding): everything will work correctly (and supports for 5.5ends with this). I guess it fixes it for OP because it simply loads it much later in the bootstrapping and then it fixes the override problem. If we all agree "it's a go", this PR should be adapted:
I'm also fine just merging and making a follow-up PR for the "cleanup" of course 😄 |
@mfn could you create a follow-up PR? |
Note: the stance on 5.5 was changed Here, from #914 (comment)
But #971 (comment) was declined (the reasons where others, but outcome is the same). Bottom-line: with the current organization of the code, unless we decide to drop 5.5, we can't merge this PR at the moment. Sad part: we've test coverage but most tests only are for L6+ simply because 5.5 is so old and I encountered lots of issues when I created e.g. the model phpdoc tests. This also means such a change will currently not break in CI 😢 , i.e. will go unnoticed unless manually tested. |
If lost issues have been fixed we could probably just tag this and drop 5.x support from here on. |
No objections from my side 🚀 |
# Conflicts: # src/IdeHelperServiceProvider.php
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 rebasing!, and sorry for response later. After PR submitted, I sorved the problem by I clone #773 file changes (IdeHelperServiceProvider.php) in my project, so Now this PR is no need for me. But, It is good news that dropping laravel 5.5 👍 |
Thanks for getting back and no problem. Eventually we'll work our way through to the other PR 😅 |
Related issue & pr
#898 ( I cant understand this issue why
IdeHelperServiceProvider
is not deferd, so excuse me if I am mistaken ... )#773
Problem Summary
When
FilesystemServiceProvider
is customized, laravel can't start because of follow error.Problem Detail
Laravel load config file to be registered.
https://github.com/laravel/framework/blob/e4d49ff7c1fbd061a7f60831e515c95b996248a6/src/Illuminate/Foundation/Application.php#L583-L594
The order of above
$providers
isIlluminate\\xxx
(ex:Illuminate\\Auth\\AuthServiceProvider
)Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider
)App\\Providers\\FilesystemServiceProvider
)Then,
IdeHelperServiceProvider->register()
,createLocalViewFactory()
are fired,$this->app['files']
is missing, laravel can't start.(Because
app['files']
meansApp\\Providers\\FilesystemServiceProvider
, and this has not been loaded. )Solution
IdeHelperServiceProvider
should bedeffer
service provider (this pull request)IdeHelperServiceProvider
should not load other container atregister()
, in this case$this->app['files']
(Resolves view factory only at services' construction time #773)