If you want, you can pick up my documentation work from https://github.com/zendframework/zf2-documentation/pull/82, which is unfinished. You can also look into https://github.com/ralphschindler/Zend_DI-Examples
Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On 10 January 2014 23:15, Philip G [via Zend Framework Community] < ml-node+s634137n4661438...@n4.nabble.com> wrote: > On Fri, Jan 10, 2014 at 12:41 PM, Matthew Weier O'Phinney > <[hidden email] <http://user/SendEmail.jtp?type=node&node=4661438&i=0>>wrote: > > > > The ServiceManager is far easier to configure, and much more > > performant (though, as with just about any generalized component, > > could be even better). > > > > If you are looking for an IoC container to manage DI for your various > > services/instances, I'd recommend Zend\ServiceManager instead of > > Zend\Di. > > > > I was looking into that, but ran into a configuration snafu when I hit the > DB component: I couldn't figure out a way to Lazy load PDO (requires a > DSN) > when the DSN is stored within the same file as the SM configuration. And > SM > Configuration doesn't have a built-in "config" pass. All that stuff is > injected via Zend MVC, which I'm not using. DI doesn't really solve this > either, but using a Proxy class could work ... maybe. > > My application is very simple: a single php tracking script. Reads in > visits, deciphers their cookies, and makes a call to a DB or Web Service > back end depending on parameters from their cookie. > > The basic requirements are: > - Speed > - Parsing and managing incoming and outgoing cookies. > - Ability to set content-type headers to either json or gif. > - Log to directly to DB or Web Services (or neither), depending on cookie > parameters. > > zend-http resolves a number of these: it gives me PhpEnv.\Request and > Response, as well as Http\Client for WS. My plan for DB was PDO directly > (using pdo_cassandra). > > Now, I want this to be easily swappable for testability, and that's where > I > ran into the trouble. Naturally, you'd think DI and a DiC; however, DiC is > notorious for not being speedy, unless configured (thus my config > question). In addition, it's not a lazy loader, something I was toying > with > the idea of Proxy class for. > > ServiceManager would resolve the swapability of RequestInterface and > ResponseInterface. But, I fell when it came to configuring for lazy > loading. PDO requires a DSN, which is stored within the same config as SM > values. And, I can't load PDO until I know "this request" is to be logged > to the DB. WS is slightly less tricky: it's not as overhead dependent, and > can be instantiated with no impact, and URL set at a later time. > > --- > Philip > [hidden email] <http://user/SendEmail.jtp?type=node&node=4661438&i=1> > http://www.gpcentre.net/ > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://zend-framework-community.634137.n4.nabble.com/Zend-Di-Di-configuration-array-tp4661430p4661438.html > To start a new topic under Zend Framework, email > ml-node+s634137n634138...@n4.nabble.com > To unsubscribe from Zend Framework Community, click > here<http://zend-framework-community.634137.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=634137&code=b2NyYW1pdXNAZ21haWwuY29tfDYzNDEzN3wxNzE0OTI1MTk4> > . > NAML<http://zend-framework-community.634137.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/Zend-Di-Di-configuration-array-tp4661430p4661449.html Sent from the Zend Framework mailing list archive at Nabble.com.