Matthew Weier O'Phinney wrote:
-- Stephan Stapel <[EMAIL PROTECTED]> wrote
(on Monday, 25 June 2007, 05:27 PM +0200):
I guess a lot of you have the problem to have code that is used within
multiple environments, a (local) environment for development, another
for testing and a third for production.
Usually, some things like database configuration differ between these
environments. I was asking myself if anyone has a smart solution for a
flexible configuration such that no additional files have to be renamed/
moved when deploying.
If someone has a good solution, would he/she like to share it?
Look through the Zend_Config documentation. Zend_Config has concepts of
both sections and inheritance, allowing you to create config files that
can be used in multiple contexts, or with contents that will differ
based on situation data. In particular, look at the Zend_Config_Ini
docs, http://framework.zend.com/manual/en/zend.config.adapters.ini.html,
which shows an example of production vs. staging configurations for a
database adapter.
Took the words right out of my mouth! But yes, what Matthew says is
correct. I have developed several sites using the ZF and this type of
configuration.
Cheers
Shaun