Symfony2: Injecting @security.context to get the current user. How to avoid a “ServiceCircularReferenceException”? Inject the whole container? [duplicate]
问题 This question already has answers here : Injecting SecurityContext into a Listener prePersist or preUpdate in Symfony2 to get User in a createdBy or updatedBy Causes Circular Reference Error (4 answers) Closed 5 years ago . Coming from this post and after fix things I'm in another issue/security question/problem. As yours may see in the other post I'm trying to inject security context in the listener but if I leave the code intact without touch I got this error: