On Mon, Jan 13, 2014 at 4:11 AM, Stefano Torresi <[email protected]>wrote:
> So there you go: https://gist.github.com/stefanotorresi/8399139 > > You may want to get it further and use an AbstractOption subclass to > enforce defaults and/or validate configs. > Oh. I see. I didn't think to use services that way. That works out well. I can even set a "class" index that has the class name to use, which would allow a simple method for DB Injections. Let me ask this now: would it be worth while just to set the while application config within a "Config" service? AbstractOption isn't necessary: it's an inhouse script only. There will be no outside users access and modifying the code. However, I do see that use in public code base; internally we can pressure our developers do to things right. I wanted DI for the purpose of unit testing. > By the way, yes, anonymous functions inside configurations array are not > cacheable, and so are object instances (i.e. using 'new Obj()' as an array > value). > > I was afraid of this. Albeit this might not be a bottle neck, speed is a concern of ours. We'll see if this has any micro-optimization speed implications in the end. Thanks! --- Philip [email protected] http://www.gpcentre.net/
