-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Closed
Labels
Description
Description
Currently, Doctrine event listeners are instantiated in order to create the Doctrine event manager. You can fix this by adding a lazy=true
option to your service (this feature was added 6+ years ago). Could we just always make this lazy? This would solve issues during cache building, where all of the listeners are instantiated.
Relevant code:
Lines 97 to 99 in 8123bb1
if ($lazy = !empty($tag['lazy'])) { | |
$taggedListenerDef->setPublic(true); | |
} |
Especially if we refactored the ContainerAwareEventManager to accept a service locator (instead of the entire container), this would be an easy win: we wouldn't even need to make the original definitions public anymore (which is the only downside).
dmaicher, cryptiklemur, vudaltsov, ro0NL, linaori and 10 more