Re: scope of config files and variables
| From: | Andrei Zmievski | Date: | Thu, 27 Dec 2001 14:18:06 +0000 |
| Subject: | Re: scope of config files and variables | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2386@lists.php.net to get a copy of this message | ||
On Sun, 23 Dec 2001, Francois Dumais wrote:
> Hi all!
>
> are there objects that permit access or query to config files series of sections like an array
> for example, from PHP. Practically speaking I would like to retrieve this object in order to know
> all the different entries made into the config file. Example:
>
> all entries in a section : $config_section[]=$config ($section_name)
> OR
> a list of sections : $sections[] = $configsections()
>
> Maybe a config should be a internal or reserved template variable (from what I gather).
>
> Thanks and a good Holiday!
You can just use Config_File class from your app directly. Example:
$conf = new Config_File();
// Get all vars from a certain section
$vars = $conf->get('file.conf', 'section');
// Get all sections
$vars = $conf->get_section_names('file.conf');
-Andrei
The church is near but the road is icy;
the bar is far away but I will walk carefully. -- Russian proverb