-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Horst Tellioglu wrote:
> Hi,
>
> I am not sure if I understand Zend_Config and it's intended use correctly.
>
> What I need is one configuration-file per application. This configuration
> file is meant to be edited by the user and should allow multiple sections
> possibly depending on each other. For example
>
> [Global]
> current.portal = 'Fisch'
>
> [Fisch]
> default.category = 'Ontology'
>
> [Gans]
> default.category = 'Epistemology'
>
>
> I would like to read this configuration _once_ at application startup and
> than
> be able to access the different sections. I can't see how this is easily
> possible with Zend_Config. Am I missing something?
>
I would use:
$config = new Zend_Config_Ini($filename, null);
This will load all sections into the $config object:
i.e.
$fischCategory = $config->Fisch->default->category;
or to pick up and array of all the defaults:
$fischDefaults = $config->Fisch->default->asArray();
Of course, you'll have to work out the name of the config file yourself
dependant on which server you are on.
Regards,
Rob...
>
> Thanks and regards,
> Horst
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFF0EvS421+qn4cITwRAjXkAJ9chHWn5/G+tc22SlLvTeT5tIbxJQCeNkUQ
WaMMr5VSNtdMzdWemC2ziiQ=
=qiXN
-----END PGP SIGNATURE-----