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()...
Post new comment