On Saturday 25 July 2009 01:09:23 Brenton Alker wrote:
>Zend_Registry is iterable, so the easiest way to get every element from
>it is to loop over it with a simple foreach on the instance itself.

I had initially done this but I had a couple of legacy objects from pre ZF 1.8 
that were in the registry before zend app is bootstrapped, these are used by 
older modules that I don't have time to refactor at the moment. Hence my 
looking for a way to get a list of resources/objects executed by zend_app's 
bootstrap process.

>I have already done what you are proposing - replace the Zend_Registry
>with a DI container - by creating a new bootstrap resource, so it
>doesn't get loaded until it's triggered by the relevant configuration
>directive.

This is the methodology I'm using, the reasoning being I can drop the config 
lines for the container resource in at the end of the resources config section 
so it's executed last.

>I've blogged about it here -
>http://blog.tekerson.com/2009/07/06/dependency-injection-container-resource-
>in-zend-framework/ - I'm using the yadif container, but it shouldn't be hard
> to alter for other containers.
>
>(It's my first attempt at writing a resource, so I'm not sure it's the
>"best" way and any feedback is appreciated.)

Thanks for sharing, my container resource is pretty much similar, I can't 
think of a better way to do this at this time.

Graham

Reply via email to