ZF-6840: Loading Zend_Application Environment Name out of a Configuration INI

Description

It would be really handy if there would be no need to somehow hard code the environment into any PHP File, and load it instead out of a configuration.ini passed to Zend_Application. This way there would be no hardcoded environment configuration somewhere in the SCM-Repository, if your configuration.ini is not in the repo.

Short example: == configuration.ini == [Application] enviroment=production [site] db.adapter = PDO_MYSQL db.params.dbname = "test" db.params.username = "test" db.params.password = "test" db.params.hostname = "test" debug = 1 [production : site] db.params.dbname = "production" debug = 0

== index.php == $application = new Zend_Application('path/to/configuration.ini'); $application->bootstrap(); $application->run();

Comments

A key part of the design of Zend_Application was that it be environment aware. This is to enforce a best practice of segregating configuration data based on the environment.

While I see your point about wanting the ability to simply pass in an array of data, or a configuration file with no "environment" definitions, this goes against the design of the component. You can achieve similar effects, however, by using your own "environment" strings (pointing to a discrete section of the configuration or passing in an array of options (in which case the environment will be ignored).