-
Notifications
You must be signed in to change notification settings - Fork 72
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
Symfony bootstrap cleanup, the new 'kernel.reset' tag should do the job #144
Conversation
Tests are failing because the Kernel mock explicitly throws an exception if bundles have not been initialized before the first request. Symfony boots the Kernel on the first request, so I'm not sure if those tests are still relevant...ping @marcj |
I believe that hacky bundle initialization was done in order to do some stuff with the session service a while ago, but that hack is no longer in place |
The tag is only used when we'd call kernel->reset, which we don't. The thing is, when you reset the kernel and throw with it all service, basically the whole performance gain is gone as well. |
@marcj actually this tag is used in https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Kernel.php#L110, it is not related with kernel->reset. Personally I think this PR makes sense with Symfony > 3, but is there a way to verify that the profiler is still working the same with the removed lines? |
Oh, you're right, sorry about that. :) Is
|
It doesn't reset the container, it just iterates the services tagged with kernel.reset and calls the reset method on them. I think it covers most of stuff we fixed through hacks. In fact with, Symfony 4, most of the hack code doesn't even get executed because most services are no longer public :) |
Yes exactly, this is precisely the point of this commit, to remove some of
the hacks php-pm had to do before now that symfony (since 3.4) has this
kernel.reset tag.
Symfony 2 has been eol-ed already and it only gets security fixes. I
believe this could go into the next release.
…On Wed, 28 Nov 2018 at 15:44, Dimosthenis Nikoudis ***@***.***> wrote:
It doesn't reset the container, it just iterates the services tagged with
kernel.reset and calls the reset method on them.
I think it covers most of stuff we fixed through hacks. In fact with,
Symfony 4, most of the hack code doesn't even get executed because most
services are no longer public :)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#144 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAyWvYhwrHoy_kXKwGHUZjPa-hw33Rppks5uzqFUgaJpZM4Y3aka>
.
|
@marcj would like to leave this with you ;) |
All up to you @andig, I haven't developed PHP for quite some time. :P |
All the removed hacks have been tested with SF 4 only. I'd still like to know what you want to do with the tests. I believe @dnna was working on a patch to make it work with symfony/monolog-bundle#279 so after that another of the hacks could be removed |
Actually @dnna PR doesn't seem related sorry! Seems like the getDebugLogger hack could also be removed, as that is triggered by the LoggerDataCollector |
3560b7d
to
b26d42e
Compare
Regarding marc's comment:
Is there any way we can unit-test this before/after? For all affected services? As admitted before- I personally have no idea about Symfony :( |
I'll take a look at it. It shouldn't be too difficult to make those tests. |
ping @acasademont is this still something you're interested in? |
Yes, but I totally forgot about it :p I'll try to make them work during this weekend :) |
First step to bulding relevant tests is at #152 |
@acasademont I understand we want to merge this after #152 to verify it still tests, right? Can we merge this one as part of a bugfix release? Please note that it also has conflict currently. Btw., you can also remove the PHPPM\Symfony\StrongerNativeSessionStorage, its no longer utilized after this PR. |
And yes, this could be a minor/patch release, we're doing nothing fancy, just removing stuff |
ping @acasademont is this something you want to get into upcoming 2.0? |
Yes, I just need to make some time for it :((( |
Is this something we could get into a 2.1 release really soonish? |
b26d42e
to
0c9499f
Compare
@andig I cleand up a bit the tests and rebased with master. Some doubts though:
|
Totally up to you. I really have no idea about the Symfony part :/
Agreed, but that would need a new mechanism and is outside of this PR's scope. So... merge for time being? |
0c9499f
to
eadb04c
Compare
Yes, I just removed the webpack checks too. Travis seems to be failing due to a weird constraint. I don't really understand why we do install symfony & drupal for the tests. any ideas @andig ? |
For static analysis: https://github.com/php-pm/php-pm-httpkernel/blob/master/.travis.yml#L19. Need to add an update dependencies flag for that to work again. |
See composer/composer#8518 for the ci error |
All the custom hijacking shouldn't be needed anymore afther SF 3.4 added the
kernel.reset
tag. Not so sure about the logger and swiftmailer hijacks