di
di copied to clipboard
[RFC] Support lazy services via ocramius/proxy-manager
Support lazy services via ocramius/proxy-manager
May be useful for view injections to initialize service only on usage
We have https://github.com/yiisoft/proxy and https://github.com/yiisoft/container-proxy btw.
As I understand those packages don't provide lazy loading but only decoration
The feature would be useful and will likely improve overall performance (not entirely sure about it).
Some references:
- https://symfony.com/doc/current/service_container/lazy_services.html
- https://php-di.org/doc/lazy-injection.html
- https://docs.laminas.dev/laminas-servicemanager/lazy-services/