Issue Type: Improvement Created: 2009-05-28T05:41:55.000+0000 Last Updated: 2009-08-21T14:02:35.000+0000 Status: Resolved Fix version(s): Reporter: Ben R. (salzig) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Application
Related issues: Attachments:
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();
Posted by Matthew Weier O'Phinney (matthew) on 2009-08-21T14:02:35.000+0000
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).
Have you found an issue?
See the Overview section for more details.