Re: [fw-general] How to use sections with Zend_Config and PHP Arrays
On 23 Sep 2008, at 18:56, Ralf Eggert wrote: Hi, has anyone any idea about this (see forwarded message)? Thanks for clarification. Best regards, Ralf Ralf Eggert schrieb am 19.09.2008 23:01: Hi, I know that both Zend_Config_Ini and Zend_Config_Xml support sections and extending sections for config data definitions. In the manual I read that Zend_Config also supports sections when used with PHP arrays. If this is right, how can this be achieved? If not, I think this passage of the manual is a little unclear: The Zend_Config family of classes enables configuration data to be organized into sections. Zend_Config adapter objects may be loaded with a single specified section, multiple specified sections, or all sections (if none are specified). http://framework.zend.com/manual/en/zend.config.theory_of_operation.html The Zend_Config adapter classes for INI and XML files support the loading of a specified section. For Zend_Config itself (which loads arrays), you just load the array you want to use. We'll have to see if we can make this clearer in the manual. Regards, Rob...
Re: [fw-general] How to use sections with Zend_Config and PHP Arrays
Hi Matthew, thanks, well the question aimed at the constructor of Zend_Config (for PHP arrays) and Zend_Config_Ini or Zend_Config_Xml. Both Ini and Xml classes take a parameter $section to just take this section out of the configuration file. But I did some thinking and I should have done that before. When I use a PHP array and I only want to create a Zend_Config object for my whatever section, I simply do: $config = new Zend_Config($configArray['whatever']); I don't know if this is the best practice way but at least it solves the issue and answers my question. I probably should do this thinking stuff more often. Didn't hurt at all and even was fun ;-) Thanks and best regards, Ralf
Re: [fw-general] How to use sections with Zend_Config and PHP Arrays
I don't know, but the easiest way to find out is create an example INI, then output the array that is generated from it for the format. -Matt On Fri, Sep 19, 2008 at 2:01 PM, Ralf Eggert <[EMAIL PROTECTED]> wrote: > Hi, > > I know that both Zend_Config_Ini and Zend_Config_Xml support sections > and extending sections for config data definitions. In the manual I read > that Zend_Config also supports sections when used with PHP arrays. If > this is right, how can this be achieved? > > If not, I think this passage of the manual is a little unclear: > > > The Zend_Config family of classes enables configuration data to be > > organized into sections. Zend_Config adapter objects may be loaded > > with a single specified section, multiple specified sections, or > > all sections (if none are specified). > > http://framework.zend.com/manual/en/zend.config.theory_of_operation.html > > Thanks for clarification. > > Best regards, > > Ralf >
Re: [fw-general] How to use sections with Zend_Config and PHP Arrays
Hi, has anyone any idea about this (see forwarded message)? Thanks for clarification. Best regards, Ralf Ralf Eggert schrieb am 19.09.2008 23:01: > Hi, > > I know that both Zend_Config_Ini and Zend_Config_Xml support sections > and extending sections for config data definitions. In the manual I read > that Zend_Config also supports sections when used with PHP arrays. If > this is right, how can this be achieved? > > If not, I think this passage of the manual is a little unclear: > >> The Zend_Config family of classes enables configuration data to be >> organized into sections. Zend_Config adapter objects may be loaded >> with a single specified section, multiple specified sections, or >> all sections (if none are specified). > > http://framework.zend.com/manual/en/zend.config.theory_of_operation.html > > Thanks for clarification. > > Best regards, > > Ralf >
[fw-general] How to use sections with Zend_Config and PHP Arrays
Hi, I know that both Zend_Config_Ini and Zend_Config_Xml support sections and extending sections for config data definitions. In the manual I read that Zend_Config also supports sections when used with PHP arrays. If this is right, how can this be achieved? If not, I think this passage of the manual is a little unclear: > The Zend_Config family of classes enables configuration data to be > organized into sections. Zend_Config adapter objects may be loaded > with a single specified section, multiple specified sections, or > all sections (if none are specified). http://framework.zend.com/manual/en/zend.config.theory_of_operation.html Thanks for clarification. Best regards, Ralf