-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Lazy services in root namespace cannot be found #34863
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
Could you please provide a small reproducer app? That'd help work on the issue. |
@nicolas-grekas i tkink it's related snc/SncRedisBundle#548 |
@nicolas-grekas Added the reproducer app to to the "How to reproduce" section above. |
Thank you for the reproducer, fixed in #35049 |
nicolas-grekas
added a commit
that referenced
this issue
Dec 19, 2019
…classes (nicolas-grekas) This PR was merged into the 3.4 branch. Discussion ---------- [ProxyManager] fix generating proxies for root-namespaced classes | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #34863 | License | MIT | Doc PR | - Commits ------- a47ae10 [ProxyManager] fix generating proxies for root-namespaced classes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Symfony version(s) affected: 4.4.0, 4.4.1
Description
After upgrading to 4.4.0 (and trying 4.4.1) when using a single container file, proxy classes for lazy services that have classes in the root namespace can't be found since the container file is in a generated namespace.
How to reproduce
Create a class without a namespace and use it as a lazy service in the container. Must be using the proxy-manager-bridge and
container.dumper.inline_factories
must betrue
.Reproducer app: https://github.com/bfeaver/lazy-service-bug
All you'll need to do is:
When it does the Symfony cache warmup, it'll fail to find the
TestService
class.Possible Solution
I traced it down to
\Zend\Code\Generator\ClassGenerator::generateShortOrCompleteClassname()
stripping off the leading backslash. If that method instead left it, there wouldn't be a problem. Maybe it would be possible to include the container's namespace as thecurrentNamespace
in theClassGenerator
. Then it wouldn't match the final if condition in that method and it would add back the backslash to the class name.The text was updated successfully, but these errors were encountered: