Closed dkarlovi closed 2 years ago
Good point. I can add the required Twig extension (only one currently) to the list of services and remove this listener altogether.
The reason why this was done like this was, that previously, we had another extension (Intl IIRC) which we used, but we could not make sure that it is activated only if it wasn't already activated. In retrospective, same might've been achieved by a compiler pass.
Currently, the only extension left has a very low chance of existing outside of Layouts (since it's one of our custom ones), so I'll just go ahead and add it directly as a service.
@dkarlovi Fixed in 1.3.6
@emodric nice! :beers:
This listener will add a Twig extension at runtime. The extension is not part of the Twig options hash which is used to generate the template cache key. When Symfony's cache warmers are running, the options hash doesn't contain the extensions added here.
This means all the Twig cache generated by the cache warmer is invalid and new cache must be created at runtime, making this bundle incompatible with read-only Symfony deployments like Docker and Lambda.