<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Zend Framework Commits - master</title>
    <description>Zend Framework git commits for branch master</description>
    <pubDate>Thu, 17 Nov 2011 13:29:05 -0800</pubDate>
    <generator>Zend_Feed_Writer 1.11.4 (http://framework.zend.com)</generator>
    <link>http://git.zendframework.com/</link>
    <author>zf-git@lists.zend.com (Zend Framework Contributors)</author>
    <dc:creator>Zend Framework Contributors</dc:creator>
    <atom:link rel="self" type="application/rss+xml" href="http://git.zendframework.com/feeds/master.xml"/>
    <item>
      <title>e66618e7c12867fde9875b8f3d92f230bd1b2727</title>
      <description><![CDATA[Init method is not called at helpers being loading via PluginClassLoader]]></description>
      <pubDate>Thu, 17 Nov 2011 13:28:46 -0800</pubDate>
      <link>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=e66618e7c12867fde9875b8f3d92f230bd1b2727</link>
      <guid>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=e66618e7c12867fde9875b8f3d92f230bd1b2727</guid>
      <content:encoded><![CDATA[Init method is not called at helpers being loading via PluginClassLoader




diff --git a/modules/ZendFramework1Mvc/library/Zend/Controller/Action/HelperBroker.php b/modules/ZendFramework1Mvc/library/Zend/Controller/Action/HelperBroker.php
index 973fe9d..135c065 100644
--- a/modules/ZendFramework1Mvc/library/Zend/Controller/Action/HelperBroker.php
+++ b/modules/ZendFramework1Mvc/library/Zend/Controller/Action/HelperBroker.php
@@ -115,6 +115,41 @@ class HelperBroker extends PluginSpecBroker implements \IteratorAggregate
 
         return $this;
     }
+    
+    /**
+     * Load and return a plugin instance
+     *
+     * If the plugin was previously loaded, returns that instance.
+     *
+     * If no options were passed, and we have no specification, load normally.
+     *
+     * If no options were passed, and we have a specification, use the
+     * specification to load an instance.
+     *
+     * Otherwise, simply try and load the plugin.
+     *
+     * @param  string $plugin
+     * @param  array
null $options
+     * @return object
+     * @throws Exception if plugin not found
+     */
+    public function load($plugin, array $options = null)
+    {
+        $pluginName = strtolower($plugin);
+        if (isset($this->plugins[$pluginName])) {
+            // If we've loaded it already, just return it
+            return $this->plugins[$pluginName];
+        }
+
+        $instance = parent::load($plugin, $options);
+
+        if (null !== $this->actionController) {
+            $instance->setActionController($this->actionController);
+            $instance->init();
+        }
+
+        return $instance;
+    }
 
     /**
      * Determine if we have a valid helper]]></content:encoded>
    </item>
    <item>
      <title>ef3df84e05788a15b1b69daa8b68312fe9bb9d98</title>
      <description><![CDATA[Merge branch 'feature/module-config-paths' of https://github.com/EvanDotPro/zf2 into feature/module-config-merging]]></description>
      <pubDate>Thu, 17 Nov 2011 13:21:37 -0800</pubDate>
      <link>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=ef3df84e05788a15b1b69daa8b68312fe9bb9d98</link>
      <guid>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=ef3df84e05788a15b1b69daa8b68312fe9bb9d98</guid>
      <content:encoded><![CDATA[Merge branch 'feature/module-config-paths' of https://github.com/EvanDotPro/zf2 into feature/module-config-merging


]]></content:encoded>
    </item>
    <item>
      <title>1a5ce03ee7d2dd31b35e88906e77b28e1df87cf0</title>
      <description><![CDATA[Added test for locator-aware functionality]]></description>
      <pubDate>Thu, 17 Nov 2011 13:17:31 -0800</pubDate>
      <link>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=1a5ce03ee7d2dd31b35e88906e77b28e1df87cf0</link>
      <guid>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=1a5ce03ee7d2dd31b35e88906e77b28e1df87cf0</guid>
      <content:encoded><![CDATA[Added test for locator-aware functionality




diff --git a/tests/Zend/Loader/PluginBrokerTest.php b/tests/Zend/Loader/PluginBrokerTest.php
index 4265262..ccf471e 100644
--- a/tests/Zend/Loader/PluginBrokerTest.php
+++ b/tests/Zend/Loader/PluginBrokerTest.php
@@ -21,7 +21,8 @@
 
 namespace ZendTest\Loader;
 
-use Zend\Loader\PluginBroker,
+use stdClass,
+    Zend\Loader\PluginBroker,
     Zend\Loader\PluginClassLoader;
 
 /**
@@ -274,4 +275,18 @@ class PluginBrokerTest extends \PHPUnit_Framework_TestCase
         $loader = $broker->getClassLoader();
         $this->assertInstanceOf('ZendTest\Loader\TestAsset\CustomClassLoader', $loader);
     }
+
+    public function testWillPullFromLocatorIfAttached()
+    {
+        $locator = new TestAsset\ServiceLocator();
+        $plugin  = new stdClass;
+        $locator->set('ZendTest\Loader\TestAsset\Foo', $plugin);
+
+        $loader = $this->broker->getClassLoader();
+        $loader->registerPlugin('foo', 'ZendTest\Loader\TestAsset\Foo');
+        $this->broker->setLocator($locator);
+
+        $test = $this->broker->load('foo');
+        $this->assertSame($plugin, $test);
+    }
 }
diff --git a/tests/Zend/Loader/TestAsset/ServiceLocator.php b/tests/Zend/Loader/TestAsset/ServiceLocator.php
new file mode 100644
index 0000000..f2ef6cb
--- /dev/null
+++ b/tests/Zend/Loader/TestAsset/ServiceLocator.php
@@ -0,0 +1,24 @@
+<
php
+
+namespace ZendTest\Loader\TestAsset;
+
+use Zend\Di\Locator;
+
+class ServiceLocator implements Locator
+{
+    protected $services = array();
+
+    public function get($name, array $params = array())
+    {
+        if (!isset($this->services[$name])) {
+            return null;
+        }
+
+        return $this->services[$name];
+    }
+
+    public function set($name, $object)
+    {
+        $this->services[$name] = $object;
+    }
+}]]></content:encoded>
    </item>
    <item>
      <title>b3a768f328c324ac313334f0cc4524cf10b95607</title>
      <description><![CDATA[Merge branch 'feature/locator-aware-pluginbroker' of https://github.com/EvanDotPro/zf2 into feature/broker-locator_aware]]></description>
      <pubDate>Thu, 17 Nov 2011 12:59:46 -0800</pubDate>
      <link>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=b3a768f328c324ac313334f0cc4524cf10b95607</link>
      <guid>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=b3a768f328c324ac313334f0cc4524cf10b95607</guid>
      <content:encoded><![CDATA[Merge branch 'feature/locator-aware-pluginbroker' of https://github.com/EvanDotPro/zf2 into feature/broker-locator_aware


]]></content:encoded>
    </item>
    <item>
      <title>1b0d659c8d647b23fb0aae4f18732f47d80ed99d</title>
      <description><![CDATA[Merge branch 'hotfix/cs-options' of https://github.com/Intiilapa/zf2 into hotfix/options-cs]]></description>
      <pubDate>Thu, 17 Nov 2011 12:57:46 -0800</pubDate>
      <link>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=1b0d659c8d647b23fb0aae4f18732f47d80ed99d</link>
      <guid>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=1b0d659c8d647b23fb0aae4f18732f47d80ed99d</guid>
      <content:encoded><![CDATA[Merge branch 'hotfix/cs-options' of https://github.com/Intiilapa/zf2 into hotfix/options-cs


]]></content:encoded>
    </item>
    <item>
      <title>bee01f357c8e005b479c8611b2e6cab6363522ba</title>
      <description><![CDATA[Add test config files]]></description>
      <pubDate>Thu, 17 Nov 2011 11:23:35 -0800</pubDate>
      <link>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=bee01f357c8e005b479c8611b2e6cab6363522ba</link>
      <guid>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=bee01f357c8e005b479c8611b2e6cab6363522ba</guid>
      <content:encoded><![CDATA[Add test config files




diff --git a/tests/Zend/Module/_files/config.bad b/tests/Zend/Module/_files/config.bad
new file mode 100644
index 0000000..e69de29
diff --git a/tests/Zend/Module/_files/config.ini b/tests/Zend/Module/_files/config.ini
new file mode 100644
index 0000000..a33e696
--- /dev/null
+++ b/tests/Zend/Module/_files/config.ini
@@ -0,0 +1,2 @@
+[all]
+ini = true
diff --git a/tests/Zend/Module/_files/config.json b/tests/Zend/Module/_files/config.json
new file mode 100644
index 0000000..d924629
--- /dev/null
+++ b/tests/Zend/Module/_files/config.json
@@ -0,0 +1 @@
+{"all":{"json":true}}
diff --git a/tests/Zend/Module/_files/config.php b/tests/Zend/Module/_files/config.php
new file mode 100644
index 0000000..cf07d40
--- /dev/null
+++ b/tests/Zend/Module/_files/config.php
@@ -0,0 +1,4 @@
+<
php
+return array(
+    'php' => true
+);
diff --git a/tests/Zend/Module/_files/config.xml b/tests/Zend/Module/_files/config.xml
new file mode 100644
index 0000000..76dee1c
--- /dev/null
+++ b/tests/Zend/Module/_files/config.xml
@@ -0,0 +1,6 @@
+<
xml version="1.0"
>
+<config>
+    <all>
+        <xml>true</xml>
+    </all>
+</config>
diff --git a/tests/Zend/Module/_files/config.yaml b/tests/Zend/Module/_files/config.yaml
new file mode 100644
index 0000000..3d533c2
--- /dev/null
+++ b/tests/Zend/Module/_files/config.yaml
@@ -0,0 +1,2 @@
+all: 
+  yaml: 1]]></content:encoded>
    </item>
    <item>
      <title>88af6cdbaca8135219f256f7e95de90444133874</title>
      <description><![CDATA[Add mergeGlobDirectory() to ConfigListener]]></description>
      <pubDate>Thu, 17 Nov 2011 10:36:38 -0800</pubDate>
      <link>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=88af6cdbaca8135219f256f7e95de90444133874</link>
      <guid>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=88af6cdbaca8135219f256f7e95de90444133874</guid>
      <content:encoded><![CDATA[Add mergeGlobDirectory() to ConfigListener

- Allows for simple global config without requiring a module for it.
- Unit tests updated



diff --git a/library/Zend/Module/Listener/ConfigListener.php b/library/Zend/Module/Listener/ConfigListener.php
index 50058c3..d2aa6aa 100644
--- a/library/Zend/Module/Listener/ConfigListener.php
+++ b/library/Zend/Module/Listener/ConfigListener.php
@@ -4,6 +4,10 @@ namespace Zend\Module\Listener;
 
 use Traversable,
     Zend\Config\Config,
+    Zend\Config\Xml as XmlConfig,
+    Zend\Config\Ini as IniConfig,
+    Zend\Config\Yaml as YamlConfig,
+    Zend\Config\Json as JsonConfig,
     Zend\Module\ModuleEvent,
     Zend\Stdlib\IteratorToArray;
 
@@ -72,7 +76,7 @@ class ConfigListener extends AbstractListener implements ConfigMerger
      * setMergedConfig 
      * 
      * @param array $config 
-     * @return Manager
+     * @return ConfigListener
      */
     public function setMergedConfig(array $config)
     {
@@ -82,10 +86,54 @@ class ConfigListener extends AbstractListener implements ConfigMerger
     }
 
     /**
+     * Merge all config files matching a glob 
+     * 
+     * @param mixed $globPath 
+     * @return ConfigListener
+     */
+    public function mergeGlobDirectory($globPath)
+    {
+        foreach (glob($globPath, GLOB_BRACE) as $path) {
+            $pathInfo = pathinfo($path);
+            switch (strtolower($pathInfo['extension'])) {
+                case 'php':
+                case 'inc':
+                    $config = include $path;
+                    break;
+
+                case 'xml':
+                    $config = new XmlConfig($path);
+                    break;
+
+                case 'json':
+                    $config = new JsonConfig($path);
+                    break;
+
+                case 'ini':
+                    $config = new IniConfig($path);
+                    break;
+
+                case 'yaml':
+                case 'yml':
+                    $config = new YamlConfig($path);
+                    break;
+
+                default:
+                    throw new Exception\RuntimeException(sprintf(
+                        'Unable to detect config file type by extension: %s',
+                        $path
+                    ));
+                    break;
+            }
+            $this->mergeTraversableConfig($config);
+        }
+    }
+
+    /**
      * mergeModuleConfig 
      * 
      * @param mixed $module 
-     * @return Manager
+     * @return ConfigListener
      */
     protected function mergeModuleConfig($module)
     {
@@ -93,23 +141,38 @@ class ConfigListener extends AbstractListener implements ConfigMerger
             && (is_callable(array($module, 'getConfig')))
         ) {
             $config = $module->getConfig($this->getOptions()->getApplicationEnvironment());
-            if ($config instanceof Traversable) {
-                $config = IteratorToArray::convert($config);
-            }
-            if (!is_array($config)) {
+            try {
+                $this->mergeTraversableConfig($config);
+            } catch (Exception\InvalidArgumentException $e) {
+                // Throw a more descriptive exception
                 throw new Exception\InvalidArgumentException(
                     sprintf('getConfig() method of %s must be an array, '
                     . 'implement the \Traversable interface, or be an '
-                    . 'instance of Zend\Config\Config', get_class($module))
+                    . 'instance of Zend\Config\Config. %s given.', 
+                    get_class($module), gettype($config))
                 );
             }
-            $this->mergedConfig = array_replace_recursive($this->mergedConfig, $config);
             if ($this->getOptions()->getConfigCacheEnabled()) {
                 $this->updateCache();
             }
         }
         return $this;
     }
+
+    protected function mergeTraversableConfig($config)
+    {
+        if ($config instanceof Traversable) {
+            $config = IteratorToArray::convert($config);
+        }
+        if (!is_array($config)) {
+            throw new Exception\InvalidArgumentException(
+                sprintf('Config being merged must be an array, '
+                . 'implement the \Traversable interface, or be an '
+                . 'instance of Zend\Config\Config. %s given.', gettype($config))
+            );
+        }
+        $this->mergedConfig = array_replace_recursive($this->mergedConfig, $config);
+    }
     
     protected function hasCachedConfig()
     {
diff --git a/library/Zend/Module/Manager.php b/library/Zend/Module/Manager.php
index 2bc6fcb..9bd6c4c 100644
--- a/library/Zend/Module/Manager.php
+++ b/library/Zend/Module/Manager.php
@@ -95,7 +95,7 @@ class Manager implements ModuleHandler
      */
     public function loadModule($moduleName)
     {
-        if (isset($this->loadModules[$moduleName])) {
+        if (isset($this->loadedModules[$moduleName])) {
             return $this->loadedModules[$moduleName];
         }
 
diff --git a/tests/Zend/Module/Listener/ConfigListenerTest.php b/tests/Zend/Module/Listener/ConfigListenerTest.php
index b3a4eaf..62e00a3 100644
--- a/tests/Zend/Module/Listener/ConfigListenerTest.php
+++ b/tests/Zend/Module/Listener/ConfigListenerTest.php
@@ -95,4 +95,21 @@ class ConfigListenerTest extends TestCase
         $moduleManager = new Manager(array('BadConfigModule', 'SomeModule'));
         $moduleManager->loadModules();
     }
+
+    public function testBadConfigFileExtensionThrowsRuntimeException()
+    {
+        $this->setExpectedException('RuntimeException');
+        $moduleManager = new Manager(array('SomeModule'));
+        $moduleManager->loadModules();
+        $moduleManager->getConfigListener()->mergeGlobDirectory(dirname(__DIR__) . '/_files/*.{bad}');
+    }
+
+    public function testCanMergeConfigFromGlob()
+    {
+        $moduleManager = new Manager(array('SomeModule'));
+        $moduleManager->loadModules();
+        $moduleManager->getConfigListener()->mergeGlobDirectory(dirname(__DIR__) . '/_files/*.{ini,json,php,xml,yaml}');
+        $config = $moduleManager->getMergedConfig(false);
+        $this->assertTrue($config['php']);
+    }
 }
diff --git a/tests/Zend/Module/Listener/ListenerOptionsTest.php b/tests/Zend/Module/Listener/ListenerOptionsTest.php
index e284d7f..ec92703 100644
--- a/tests/Zend/Module/Listener/ListenerOptionsTest.php
+++ b/tests/Zend/Module/Listener/ListenerOptionsTest.php
@@ -12,23 +12,27 @@ class ListenerOptionsTest extends TestCase
     public function testCanConfigureWithArrayInConstructor()
     {
         $options = new ListenerOptions(array(
-            'cache_dir'            => __DIR__,
-            'config_cache_enabled' => true,
-            'config_cache_key'     => 'foo',
+            'cache_dir'               => __DIR__,
+            'config_cache_enabled'    => true,
+            'config_cache_key'        => 'foo',
+            'application_environment' => 'development',
         ));
         $this->assertSame($options->getCacheDir(), __DIR__);
         $this->assertTrue($options->getConfigCacheEnabled());
         $this->assertNotNull(strstr($options->getConfigCacheFile(), __DIR__));
         $this->assertNotNull(strstr($options->getConfigCacheFile(), '.php'));
         $this->assertSame($options->getConfigCacheKey(), 'foo');
+        $this->assertSame($options->getApplicationEnvironment(), 'development');
     }
 
     public function testCanAccessKeysAsProperties()
     {
         $options = new ListenerOptions(array(
-            'cache_dir'            => __DIR__,
-            'config_cache_enabled' => true,
+            'cache_dir'               => __DIR__,
+            'config_cache_enabled'    => true,
+            'application_environment' => 'development',
         ));
+        $this->assertSame($options->application_environment, 'development');
         $this->assertSame($options->cache_dir, __DIR__);
         $options->cache_dir = 'foo';
         $this->assertSame($options->cache_dir, 'foo');
diff --git a/tests/Zend/Module/ManagerTest.php b/tests/Zend/Module/ManagerTest.php
index 286136b..1b19f53 100644
--- a/tests/Zend/Module/ManagerTest.php
+++ b/tests/Zend/Module/ManagerTest.php
@@ -114,6 +114,7 @@ class ManagerTest extends TestCase
         $modules = $moduleManager->getLoadedModules(true);
         $this->assertSame(1, count($modules));
         $moduleManager->loadModules(); // should not cause any problems
+        $moduleManager->loadModule('BarModule'); // should not cause any problems
         $modules = $moduleManager->getLoadedModules(true); // BarModule already loaded so nothing happens
         $this->assertSame(1, count($modules));
 ]]></content:encoded>
    </item>
    <item>
      <title>0a14af9a4b82f5327921732c00e8cfbb4bad3250</title>
      <description><![CDATA[Pass the exception for ERROR_CONTROLLER_INVALID and ERROR_CONTROLLER_NOT_FOUND through for view listener to use]]></description>
      <pubDate>Thu, 17 Nov 2011 06:51:35 -0800</pubDate>
      <link>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=0a14af9a4b82f5327921732c00e8cfbb4bad3250</link>
      <guid>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=0a14af9a4b82f5327921732c00e8cfbb4bad3250</guid>
      <content:encoded><![CDATA[Pass the exception for ERROR_CONTROLLER_INVALID and ERROR_CONTROLLER_NOT_FOUND through for view listener to use




diff --git a/library/Zend/Mvc/Application.php b/library/Zend/Mvc/Application.php
index e8487e1..2a04c7b 100644
--- a/library/Zend/Mvc/Application.php
+++ b/library/Zend/Mvc/Application.php
@@ -267,7 +267,8 @@ class Application implements AppContext
         } catch (ClassNotFoundException $exception) {
             $error = clone $e;
             $error->setError(static::ERROR_CONTROLLER_NOT_FOUND)
-                  ->setController($controllerName);
+                  ->setController($controllerName)
+                  ->setParam('exception', $exception);
 
             $results = $events->trigger('dispatch.error', $error);
             if (count($results)) {
@@ -282,7 +283,8 @@ class Application implements AppContext
             $error = clone $e;
             $error->setError(static::ERROR_CONTROLLER_INVALID)
                   ->setController($controllerName)
-                  ->setControllerClass(get_class($controller));
+                  ->setControllerClass(get_class($controller))
+                  ->setParam('exception', $exception);
             $results = $events->trigger('dispatch.error', $error);
             if (count($results)) {
                 $return  = $results->last();]]></content:encoded>
    </item>
    <item>
      <title>4fa59463966bcc66344df9a9dcbd1ab4d4b55767</title>
      <description><![CDATA[Merge branch 'hotfix/module-listener-optins']]></description>
      <pubDate>Wed, 16 Nov 2011 14:55:15 -0800</pubDate>
      <link>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=4fa59463966bcc66344df9a9dcbd1ab4d4b55767</link>
      <guid>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=4fa59463966bcc66344df9a9dcbd1ab4d4b55767</guid>
      <content:encoded><![CDATA[Merge branch 'hotfix/module-listener-optins'


]]></content:encoded>
    </item>
    <item>
      <title>f3dda919cec4a87bbcbe0b73fee1eeac276cfe48</title>
      <description><![CDATA[Fix bad test assumption]]></description>
      <pubDate>Wed, 16 Nov 2011 14:55:08 -0800</pubDate>
      <link>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=f3dda919cec4a87bbcbe0b73fee1eeac276cfe48</link>
      <guid>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=f3dda919cec4a87bbcbe0b73fee1eeac276cfe48</guid>
      <content:encoded><![CDATA[Fix bad test assumption

- config_cache_key should equal application_environment by default



diff --git a/tests/Zend/Module/Listener/ListenerOptionsTest.php b/tests/Zend/Module/Listener/ListenerOptionsTest.php
index 9f7f1e0..e284d7f 100644
--- a/tests/Zend/Module/Listener/ListenerOptionsTest.php
+++ b/tests/Zend/Module/Listener/ListenerOptionsTest.php
@@ -40,6 +40,6 @@ class ListenerOptionsTest extends TestCase
         $options->config_cache_enabled = false;
         $this->assertFalse($options->config_cache_enabled);
 
-        $this->assertNull($options->config_cache_key);
+        $this->assertEquals($options->application_environment, $options->config_cache_key);
     }
 }]]></content:encoded>
    </item>
    <item>
      <title>920663681ad817ad8702b95f14b1bed38d7b972d</title>
      <description><![CDATA[Fix call to old getApplicationEnv() method in module listener options]]></description>
      <pubDate>Wed, 16 Nov 2011 14:47:23 -0800</pubDate>
      <link>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=920663681ad817ad8702b95f14b1bed38d7b972d</link>
      <guid>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=920663681ad817ad8702b95f14b1bed38d7b972d</guid>
      <content:encoded><![CDATA[Fix call to old getApplicationEnv() method in module listener options




diff --git a/library/Zend/Module/Listener/ListenerOptions.php b/library/Zend/Module/Listener/ListenerOptions.php
index 4d04459..9eeb7b7 100644
--- a/library/Zend/Module/Listener/ListenerOptions.php
+++ b/library/Zend/Module/Listener/ListenerOptions.php
@@ -58,7 +58,7 @@ class ListenerOptions extends Options
         if ($this->configCacheKey !== null) {
             return $this->configCacheKey;
         }
-        return $this->getApplicationEnv();
+        return $this->getApplicationEnvironment();
     }
 
     /**]]></content:encoded>
    </item>
    <item>
      <title>1188b77dc13eb1a8c822bc16835c502800db69f8</title>
      <description><![CDATA[Merge branch 'feature/router' of https://github.com/DASPRiD/zf2 into hotfix/router-testing]]></description>
      <pubDate>Wed, 16 Nov 2011 14:10:38 -0800</pubDate>
      <link>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=1188b77dc13eb1a8c822bc16835c502800db69f8</link>
      <guid>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=1188b77dc13eb1a8c822bc16835c502800db69f8</guid>
      <content:encoded><![CDATA[Merge branch 'feature/router' of https://github.com/DASPRiD/zf2 into hotfix/router-testing


]]></content:encoded>
    </item>
    <item>
      <title>be0c7b139cca302cc18a1ee5de5242897598f5d7</title>
      <description><![CDATA[Fixed handling of Traversable with child_routes]]></description>
      <pubDate>Wed, 16 Nov 2011 14:07:19 -0800</pubDate>
      <link>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=be0c7b139cca302cc18a1ee5de5242897598f5d7</link>
      <guid>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=be0c7b139cca302cc18a1ee5de5242897598f5d7</guid>
      <content:encoded><![CDATA[Fixed handling of Traversable with child_routes




diff --git a/library/Zend/Mvc/Router/Http/TreeRouteStack.php b/library/Zend/Mvc/Router/Http/TreeRouteStack.php
index dbcad9c..ae89b15 100644
--- a/library/Zend/Mvc/Router/Http/TreeRouteStack.php
+++ b/library/Zend/Mvc/Router/Http/TreeRouteStack.php
@@ -25,6 +25,8 @@
 namespace Zend\Mvc\Router\Http;
 
 use Zend\Mvc\Router\Exception,
+    Traversable,
+    Zend\Stdlib\IteratorToArray,
     Zend\Mvc\Router\SimpleRouteStack,
     Zend\Mvc\Router\Route as BaseRoute,
     Zend\Mvc\Router\Http\Route,
@@ -103,6 +105,14 @@ class TreeRouteStack extends SimpleRouteStack
      */
     protected function routeFromArray($specs)
     {
+        if (!is_array($specs) && !$specs instanceof Traversable) {
+            throw new Exception\InvalidArgumentException('Route definition must be an array or Traversable object');
+        }
+
+        if ($specs instanceof Traversable) {
+            $specs = IteratorToArray::convert($specs);
+        }
+        
         $route = parent::routeFromArray($specs);
 
         if (!$route instanceof Route) {]]></content:encoded>
    </item>
    <item>
      <title>eef97e49075e947f50012824d73b6cc41435b4c0</title>
      <description><![CDATA[Add application_environment parameter to module listener options]]></description>
      <pubDate>Wed, 16 Nov 2011 13:44:01 -0800</pubDate>
      <link>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=eef97e49075e947f50012824d73b6cc41435b4c0</link>
      <guid>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=eef97e49075e947f50012824d73b6cc41435b4c0</guid>
      <content:encoded><![CDATA[Add application_environment parameter to module listener options

This allows for cleanly injecting the environment without relying on a constant



diff --git a/library/Zend/Module/Listener/ConfigListener.php b/library/Zend/Module/Listener/ConfigListener.php
index 7b77d53..50058c3 100644
--- a/library/Zend/Module/Listener/ConfigListener.php
+++ b/library/Zend/Module/Listener/ConfigListener.php
@@ -92,7 +92,7 @@ class ConfigListener extends AbstractListener implements ConfigMerger
         if ((false === $this->skipConfig)
             && (is_callable(array($module, 'getConfig')))
         ) {
-            $config = $module->getConfig($this->getOptions()->getApplicationEnv());
+            $config = $module->getConfig($this->getOptions()->getApplicationEnvironment());
             if ($config instanceof Traversable) {
                 $config = IteratorToArray::convert($config);
             }
diff --git a/library/Zend/Module/Listener/ListenerOptions.php b/library/Zend/Module/Listener/ListenerOptions.php
index b64443f..4d04459 100644
--- a/library/Zend/Module/Listener/ListenerOptions.php
+++ b/library/Zend/Module/Listener/ListenerOptions.php
@@ -14,12 +14,17 @@ class ListenerOptions extends Options
     /**
      * @var string
      */
-    protected $configCacheKey = null;
+    protected $configCacheKey;
 
     /**
      * @var string
      */
-    protected $cacheDir = null;
+    protected $cacheDir;
+
+    /**
+     * @var string
+     */
+    protected $applicationEnvironment;
 
     /**
      * Check if the config cache is enabled
@@ -107,9 +112,25 @@ class ListenerOptions extends Options
         return $this;
     }
 
-    public function getApplicationEnv()
+    /**
+     * Get the application environment being used
+     *
+     * @return string
+     */
+    public function getApplicationEnvironment()
     {
-        return defined('APPLICATION_ENV') 
 APPLICATION_ENV : null;
+        return $this->applicationEnvironment 
: 'production';
+    }
+ 
+    /**
+     * Set the application environment to use
+     *
+     * @param string $applicationEnvironment the value to be set
+     */
+    public function setApplicationEnvironment($applicationEnvironment)
+    {
+        $this->applicationEnvironment = $applicationEnvironment;
+        return $this;
     }
 
     /**]]></content:encoded>
    </item>
    <item>
      <title>63a50a28b6ce0cedf0dd5bd153e66999383876cb</title>
      <description><![CDATA[s/NULL/null in Zend\Module\Listener\ListenerOptions]]></description>
      <pubDate>Wed, 16 Nov 2011 05:46:51 -0800</pubDate>
      <link>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=63a50a28b6ce0cedf0dd5bd153e66999383876cb</link>
      <guid>http://git.zendframework.com/?a=commit&amp;p=zf&amp;h=63a50a28b6ce0cedf0dd5bd153e66999383876cb</guid>
      <content:encoded><![CDATA[s/NULL/null in Zend\Module\Listener\ListenerOptions




diff --git a/library/Zend/Module/Listener/ListenerOptions.php b/library/Zend/Module/Listener/ListenerOptions.php
index 8eb7823..b64443f 100644
--- a/library/Zend/Module/Listener/ListenerOptions.php
+++ b/library/Zend/Module/Listener/ListenerOptions.php
@@ -14,12 +14,12 @@ class ListenerOptions extends Options
     /**
      * @var string
      */
-    protected $configCacheKey = NULL;
+    protected $configCacheKey = null;
 
     /**
      * @var string
      */
-    protected $cacheDir = NULL;
+    protected $cacheDir = null;
 
     /**
      * Check if the config cache is enabled
@@ -109,7 +109,7 @@ class ListenerOptions extends Options
 
     public function getApplicationEnv()
     {
-        return defined('APPLICATION_ENV') 
 APPLICATION_ENV : NULL;
+        return defined('APPLICATION_ENV') 
 APPLICATION_ENV : null;
     }
 
     /**
]]></content:encoded>
    </item>
  </channel>
</rss>

