php-pm / php-pm-httpkernel

HttpKernel adapter for use of Symfony and Laravel frameworks with PHP-PM
MIT License
246 stars 72 forks source link

Don't reset Registry if it implements ResetInterface #162

Closed dnna closed 4 years ago

dnna commented 4 years ago

Aside from the other issues DoctrineBundle 2.0.6 introduced, it also results in resetting the entity manager twice on every request (one reset is done from Symfony and the other one from us).

This PR prevents this behavior by checking whether the Registry implements ResetInterface and not executing our reset if it does.

andig commented 4 years ago

LGTM /cc @acasademont

acasademont commented 4 years ago

Totally +1. I still need to investigate the causes of doctrine/DoctrineBundle#1114 though and try to understand why are they are always resetting the EM instead of just clearing as we do (except when the EM has been closed)

andig commented 4 years ago

CI is broken due to version mismatch, but thats a separate topic. Need to find out if its due to travis composer cache or a real problem.