Index: library/Zend/Application.php =================================================================== --- library/Zend/Application.php (revision 23137) +++ library/Zend/Application.php (working copy) @@ -387,6 +387,14 @@ $config = new Zend_Config_Xml($file, $environment); break; + case 'json': + $config = new Zend_Config_Json($file, $environment); + break; + + case 'yaml': + $config = new Zend_Config_Yaml($file, $environment); + break; + case 'php': case 'inc': $config = include $file; Index: tests/Zend/Application/_files/appconfig.json =================================================================== --- tests/Zend/Application/_files/appconfig.json (revision 0) +++ tests/Zend/Application/_files/appconfig.json (revision 0) @@ -0,0 +1,8 @@ +{ + "production": { + "foo": "bar" + }, + "testing": { + "_extends": "production" + } +} \ No newline at end of file Index: tests/Zend/Application/_files/appconfig.yaml =================================================================== --- tests/Zend/Application/_files/appconfig.yaml (revision 0) +++ tests/Zend/Application/_files/appconfig.yaml (revision 0) @@ -0,0 +1,7 @@ +production: + foo: "bar" + +testing: + _extends: production + + \ No newline at end of file Index: tests/Zend/Application/ApplicationTest.php =================================================================== --- tests/Zend/Application/ApplicationTest.php (revision 23137) +++ tests/Zend/Application/ApplicationTest.php (working copy) @@ -289,6 +289,24 @@ $this->assertTrue($application->hasOption('foo')); } + /** + * @group ZF-10568 + */ + public function testPassingStringYamlConfigPathOptionToConstructorShouldLoadOptions() + { + $application = new Zend_Application('testing', dirname(__FILE__) . '/_files/appconfig.yaml'); + $this->assertTrue($application->hasOption('foo')); + } + + /** + * @group ZF-10568 + */ + public function testPassingStringJsonConfigPathOptionToConstructorShouldLoadOptions() + { + $application = new Zend_Application('testing', dirname(__FILE__) . '/_files/appconfig.json'); + $this->assertTrue($application->hasOption('foo')); + } + public function testPassingArrayOptionsWithConfigKeyShouldLoadOptions() { $application = new Zend_Application('testing', array('bar' => 'baz', 'config' => dirname(__FILE__) . '/_files/appconfig.inc')); @@ -458,7 +476,7 @@ $this->assertEquals(1, $application->getBootstrap()->fooExecuted); $this->assertEquals(0, $application->getBootstrap()->barExecuted); } - + public function testOptionsCanHandleMuiltipleConigFiles() { $application = new Zend_Application('testing', array( @@ -468,7 +486,7 @@ ) ) ); - + $this->assertEquals('baz', $application->getOption('foo')); } } Index: documentation/manual/en/module_specs/Zend_Application-QuickStart.xml =================================================================== --- documentation/manual/en/module_specs/Zend_Application-QuickStart.xml (revision 23137) +++ documentation/manual/en/module_specs/Zend_Application-QuickStart.xml (working copy) @@ -199,7 +199,7 @@ Now, create your configuration. For this tutorial, we will use an INI style configuration; you may, of course, use an - XML or PHP configuration file as well. Create + XML or JSON or YAML or PHP configuration file as well. Create the file application/configs/application.ini, and provide the following contents: