Using Symfony Dependency Injection with Zend_Application - Benja...

Courtesy Planet PHP  Sat, 07/04/2009 - 01:28

As a follow-up to my recent post on Dependency Injection containers and Zend_Application I was eager to find out if its possible to integrate the new Symfony Dependency Injection Container into the Zend Framework.

To my suprise its possible without having to make any changes to one of the two components. An example use-case would look like:

$container = new sfServiceContainerBuilder(); $loader = new sfServiceContainerLoaderFileXml($container); $loader->load(APPLICATION_PATH.'/config/objects.xml'); $application = new Zend_Application( APPLICATION_ENV, APPLICATION_PATH .

'/config/application.xml' ); $application->getBootstrap()->setContainer($container); $application->bootstrap()...


 

More related items

Rdavid.net: My Zend Framework Model Layer: Part...
In a new post on the Rdavid.net blog there's some discussion about Zend Framework models, the best approach and a "Service Class" idea. After some more thought and lots of research on the...

Joey Rivera's Blog: Caching using PHP/Zend_Cache and...
New on his blog today Joey Rivera has posted this tutorial about using the Zend_Cache component of the Zend Framework to boost the performance of your site. I like the definition used in...

ZendCasts: Using Zend_Cache to speed up Web Service...
On the ZendCasts site today there's a new video looking at the Zend_Cache component of the Zend Framework and how it can be used to speed up the response time for things like calls to a web...

HP W1907 19-inch Widescreen Flat Panel LCD Monitor
With a resolution of 1440 x 900 and wide workspace, you can watch videos, edit photos, surf the net or play games with the HP W1907. Its wide aspect ratio and fast response time bring work...

NZXT ACC-NT-CRYO-S 120MM Aluminum Notebook Cooler...
CRYO LX SILVER - ALUMINUM COOLER FOR POWER NOTEBOOKS


 

Post new comment

The content of this field is kept private and will not be shown publicly.
computer-internet.marc8.com