zendframework / zend-servicemanager

ServiceManager component from Zend Framework
BSD 3-Clause "New" or "Revised" License
188 stars 89 forks source link

[Zend\ServiceManager] Add alternatives services proposals when service not found is thrown #129

Open GeeH opened 8 years ago

GeeH commented 8 years ago

This issue has been moved from the zendframework repository as part of the bug migration program as outlined here - http://framework.zend.com/blog/2016-04-11-issue-closures.html


Original Issue: https://api.github.com/repos/zendframework/zendframework/issues/6836 User: @blanchonvincent Created On: 2014-11-03T14:33:39Z Updated At: 2015-02-19T20:09:54Z Body This idea comes from symfony, it would be good to add some details about services that are close (about name). This point can help developer to save time during the debug.


Comment

User: @blanchonvincent Created On: 2014-11-03T17:21:43Z Updated At: 2014-11-03T17:21:43Z Body The travis fail seems pretty strange


Comment

User: @manchuck Created On: 2014-11-03T19:57:41Z Updated At: 2014-11-03T19:57:41Z Body I would want an option to disable this feature for production.


Comment

User: @blanchonvincent Created On: 2014-11-03T20:01:19Z Updated At: 2014-11-03T20:01:19Z Body @manchuck why?


Comment

User: @manchuck Created On: 2014-11-03T20:10:51Z Updated At: 2014-11-03T20:10:51Z Body If by some chance something gets released to prod with that causes this to be called, having a lev look up can cause a slowdown. If someone finds this out, it could bring the sever to a crawl doing all these look ups


Comment

User: @blanchonvincent Created On: 2014-11-03T20:15:55Z Updated At: 2014-11-03T20:17:24Z Body @manchuck I think the lev method consume less memory cpu/memory than a big sql request, so if someone want to put the mess in your server with malicious action, it's pretty easy to do that without these lines :)


Comment

User: @blanchonvincent Created On: 2014-11-04T20:29:08Z Updated At: 2014-11-04T20:29:08Z Body @manchuck After considering it, if the developers want to handle the exception from the service manager to load services from another manager as a fallback of provide a default action, it can be good to allow to deactivate this feature. I would like other reviews about this PR. Thank you for your time. :+1:


Comment

User: @mpalourdio Created On: 2014-11-04T20:33:58Z Updated At: 2014-11-04T20:41:06Z Body I'm definitely +1 with this feature for a dev environment. I like this feature in symfony. I once thought about adding it into ZDT. Maybe it would better land in ZDT, as it's more a dev specific information, no ?


Comment

User: @Ocramius Created On: 2014-11-22T08:19:34Z Updated At: 2014-11-22T08:19:34Z Body I had implemented this as an abstract factory once :-) I suggest doing the same in this case ;-)


Comment

User: @Pittiplatsch Created On: 2014-11-24T17:54:00Z Updated At: 2014-11-24T17:54:00Z Body @Ocramius Nice idea. If done properly, this abstract factory can be configured for dev env's only. :+1:


Comment

User: @Ocramius Created On: 2014-12-06T01:33:11Z Updated At: 2014-12-06T01:33:21Z Body I suggest looking at https://github.com/Ocramius/zf2/blob/95ad5fd6877335f8670b3635952e5bdaa696dc00/library/Zend/ServiceManager/Zf2Compat/ServiceNameNormalizerAbstractFactory.php for that.


Comment

User: @weierophinney Created On: 2015-02-19T20:09:54Z Updated At: 2015-02-19T20:09:54Z Body I'm with @Ocramius on this one; let's implement it as an abstract factory. Developers can then enable/disable at will, and it doesn't require changes to the service manager itself.


weierophinney commented 4 years ago

This repository has been closed and moved to laminas/laminas-servicemanager; a new issue has been opened at https://github.com/laminas/laminas-servicemanager/issues/24.