You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.
I'm using the \Zend\ServiceManager\Di\DiAbstractServiceFactory to initialize objects and resolve their dependencies. But I have an issue with recursion in the \Zend\ServiceManager\ServiceManager::has.
I've added the \Zend\ServiceManager\Di\DiAbstractServiceFactory (it's also not a trivial task because service manager calls new during abstract factory initialization) to list of abstract factories.
During object initialization by ServiceManager via DiAbstractServiceFactory the \Zend\ServiceManager\Di\DiServiceFactory::get will be called to create the object and this method calls \Zend\ServiceManager\ServiceManager::has to check if ServiceManager can create this object; in its turn ServiceManagerwill check if configured abstract factories have possibility to create this object.
This behavior in the couple of \Zend\ServiceManager\Di\DiServiceFactory::get implementation causes the circular recursion. The previous implementation of \Zend\ServiceManager\ServiceManager::has was smarter and didn't have this issue.
Specifying \Zend\ServiceManager\Di\DiServiceFactory::USE_SL_AFTER_DI during DiAbstractServiceFactory doesn't solve this issue because other dependencies cannot be resolved.
I'm using the
\Zend\ServiceManager\Di\DiAbstractServiceFactory
to initialize objects and resolve their dependencies. But I have an issue with recursion in the\Zend\ServiceManager\ServiceManager::has
.I've added the
\Zend\ServiceManager\Di\DiAbstractServiceFactory
(it's also not a trivial task because service manager callsnew
during abstract factory initialization) to list of abstract factories.During object initialization by
ServiceManager
viaDiAbstractServiceFactory
the\Zend\ServiceManager\Di\DiServiceFactory::get
will be called to create the object and this method calls\Zend\ServiceManager\ServiceManager::has
to check ifServiceManager
can create this object; in its turnServiceManager
will check if configured abstract factories have possibility to create this object.This behavior in the couple of \Zend\ServiceManager\Di\DiServiceFactory::get implementation causes the circular recursion. The previous implementation of
\Zend\ServiceManager\ServiceManager::has
was smarter and didn't have this issue.Specifying
\Zend\ServiceManager\Di\DiServiceFactory::USE_SL_AFTER_DI
duringDiAbstractServiceFactory
doesn't solve this issue because other dependencies cannot be resolved.zend-servicemanager-di 1.1.0
zend-servicemanager 3.3.0
Originally posted by @joni-jones at zendframework/zend-servicemanager#186
The text was updated successfully, but these errors were encountered: