From e5ebb1f4a4affc00c746ddec566ccc257d1f5b6d Mon Sep 17 00:00:00 2001 From: Evan Coury Date: Fri, 7 Oct 2011 13:17:14 -0700 Subject: [PATCH] Update for new Zend\Di and Zend\Code stuff - Change ZF2 submodule to use git.zendframework.com to keep up to date better - Change bootstrapping and Di config strategy slightly to account for Ralph's Zend\Di and Zend\Code changes --- .gitmodules | 2 +- library/ZendFramework | 2 +- modules/Application/configs/module.config.php | 6 +----- modules/Application/src/Application/Bootstrap.php | 16 ++++++---------- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/.gitmodules b/.gitmodules index 80fc458..670b03e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "library/ZendFramework"] path = library/ZendFramework - url = git://github.com/zendframework/zf2.git + url = git://git.zendframework.com/zf.git diff --git a/library/ZendFramework b/library/ZendFramework index 33edf4c..31831f1 160000 --- a/library/ZendFramework +++ b/library/ZendFramework @@ -1 +1 @@ -Subproject commit 33edf4c5cd373fe8150b1d2b5245eca095a77825 +Subproject commit 31831f1865398750695fae11a919b396add4ae5d diff --git a/modules/Application/configs/module.config.php b/modules/Application/configs/module.config.php index 3b5caf2..8b9a28d 100644 --- a/modules/Application/configs/module.config.php +++ b/modules/Application/configs/module.config.php @@ -25,17 +25,13 @@ return array( ), 'Zend\View\PhpRenderer' => array( - 'methods' => array( - 'setResolver' => array( + 'parameters' => array( 'resolver' => 'Zend\View\TemplatePathStack', 'options' => array( 'script_paths' => array( 'application' => __DIR__ . '/../views', ), ), - ), - ), - 'parameters' => array( 'broker' => 'Zend\View\HelperBroker', ), ), diff --git a/modules/Application/src/Application/Bootstrap.php b/modules/Application/src/Application/Bootstrap.php index fed8b36..722919a 100644 --- a/modules/Application/src/Application/Bootstrap.php +++ b/modules/Application/src/Application/Bootstrap.php @@ -4,7 +4,8 @@ namespace Application; use Zend\Config\Config, Zend\Di\Configuration, Zend\Di\Definition, - Zend\Di\DependencyInjector, + Zend\Di\DefinitionList, + Zend\Di\Di, Zend\EventManager\StaticEventManager, Zend\Module\Manager as ModuleManager, Zend\Mvc\Application; @@ -29,15 +30,10 @@ class Bootstrap protected function setupLocator(Application $app) { - $definition = new Definition\AggregateDefinition; - $definition->addDefinition(new Definition\RuntimeDefinition); - - $di = new DependencyInjector; - $di->setDefinition($definition); - - $config = new Configuration($this->config->di); - $config->configure($di); - + $definition = new Definition\RuntimeDefinition; + $definition->getIntrospectionStrategy()->setUseAnnotations(false); + $di = new Di(new DefinitionList($definition), null, new Configuration($this->config->di)); + $di->instanceManager()->addTypePreference('Zend\Di\Locator', $di); $app->setLocator($di); } -- 1.7.10.4