-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Symfony 2.8.10 no longer allows the ContainerBuilder as base class #19858
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
Comments
Relates to #19704 |
@nicolas-grekas Told you that was a BC break. |
@nicolas-grekas I gave it a bit more thought and what I suspect that the core problem is PhpDumper losing information about "synthetic" services in the dumped container so there is now way even in default Symfony scenario to check whether calls to |
Indeed we've overridden some more in the Kernel, what cases could lead to problems? Our changes are related to the locations of log and cache files, the bundles to include, the default services file to load and the name of the cached container. |
@RonRademaker it seems the |
Let's revert |
@RonRademaker can you confirm your issue is fixed and everything works fine after using |
I had the exact same issue with all my synthetic services and using Container fixed it yes |
@nicolas-grekas I haven't been able to fully test, because our use case is a framework that runs many sites and I can't risk breaking all. So, some others will have to look into this as well. |
…icolas-grekas) This PR was merged into the 2.7 branch. Discussion ---------- [DI] Fix setting synthetic services on ContainerBuilder | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | Tests pass? | yes | Fixed tickets | #19858 | License | MIT `ContainerBuilder` doesn't allow setting a service while it's frozen and has no corresponding definition. Yet, the base `Container` doesn't have this limitation. See linked issue for some context. Commits ------- 42244f2 [DI] Fix setting synthetic services on ContainerBuilder
We use a custom DIC based on ContainerBuilder in one of our projects. Our Kernel overwrites the
getContainerBaseClass
in order to make sure this DIC is used instead ofContainer
. As of Symfony 2.8.10 this is broken due to symfony/dependency-injection@e0eeba7#diff-7f4e44bf5b03bfea768fbd537f88c20bR147Reproduction code:
composer.json
src/Kernel.php
src/issue.php
Result:
The solution could be to extend from
Container
instead ofContainerBuilder
, but at this time I don't yet know it that has any other consequences.The text was updated successfully, but these errors were encountered: