[fw-general] Merging two Zend_Configs

2006-12-22 Thread Steve
Hi, I've been trying to figure out the best way to merge two Zend_Config objects together. What I want to be able to do is have one master INI file in my application directory and then one INI file per application instance, which will allow me to override settings in the master INI file. I

Re: [fw-general] Merging two Zend_Configs

2006-12-22 Thread Simon Mundy
Hi Steve, You only need the one ini file for that. You can break up the ini file into 'sections', with each section having the ability to inherit from previous sections. For example:- [all] db.username = foo db.password = bar db.database = mydatabase [development:all] db.username = foodev

Re: [fw-general] Merging two Zend_Configs

2006-12-22 Thread Steve
to configure their own site. Thanks, Steve - Original Message - From: Simon Mundy [EMAIL PROTECTED] To: Zend Framework fw-general@lists.zend.com Sent: Friday, December 22, 2006 12:22 PM Subject: Re: [fw-general] Merging two Zend_Configs Hi Steve, You only need the one ini file

Re: [fw-general] Merging two Zend_Configs

2006-12-22 Thread Matthew Ratzloff
() would have to be added in that case. Rob? -Matt - Original Message - From: Steve [EMAIL PROTECTED] To: fw-general@lists.zend.com Sent: Friday, December 22, 2006 4:03 AM Subject: [fw-general] Merging two Zend_Configs Hi, I've been trying to figure out the best way to merge two

Re: [fw-general] Merging two Zend_Configs

2006-12-22 Thread Nico Edtinger
You could use array_merge(): ?php require_once 'Zend.php'; Zend::loadClass('Zend_Config'); $master_config = new Zend_Config(array('x' = 1, 'y' = 2, 'z' = 3)); $user_config = new Zend_Config(array('y' = 4, 'a' = 5)); $config = new Zend_Config(array_merge($master_config-asArray(),