Better support for config-files in the .php code
| From: | Sven Axelsson | Date: | Thu, 02 May 2002 12:42:57 +0000 |
| Subject: | Better support for config-files in the .php code | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-3981@lists.php.net to get a copy of this message | ||
Anyone but me who thinks accessing the loaded config files from the .PHP
code is useful?
I added the following function to the Config_File class in
Config_File.class.php.
function &get_all($section_name = null, $var_name = null)
{
$vars = array();
foreach ($this->get_file_names() as $path)
{
$res = &$this->get(basename($path), $section_name, $var_name);
$vars = array_merge($vars, $res);
}
return $vars;
}
Using this I can pick up config information from any loaded file without
knowing the name.
/sven axelsson, bok & webb i göteborg ab