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.
Replace
(new CarbonServiceProvider($event->app))->updateLocale();
with a re-boot of all providers after the new app has been re-attached to them.The point of this change is to have a generic handling of providers that would work the same as in typical installas (expect 1 boot() for each request) instead of handling specifically each provider.
It would be safer that providers that don't need to be re-booted would expose some interface/flag so Octane would skip them (so it can still be optimized as much as possible) + a manual exception list that Octane can have for the basic stuff, than the other way round where booting is skipped by default (which might fall unexpected for most providers) and each provider having to adapt their code to support Octane.
Suggestion for interface can be:
If present Octane would call
$provider->bootWithOctaneApp($app)
instead of$app->bootProvider($provider)
and it would be up to the provider implementing the interface to decide which callbacks/events/etc. to do or keep the method void to do nothing.The annoying part is the
Closure
used to manipulate protected properties ofApplication
andServiceProvider
but if we agree on the principle first, we might add methods toIlluminate\Foundation\Application
andIlluminate\Support\ServiceProvider
to allow this without entering the protected scope.