Source for file Config.php
Documentation is available at Config.php
* Load and save configuration files
* This class currently supports the following config file formats:
* This class can be used by any module as follows:-
* - $this->exec_module_action('Config', 'read_ini_file', $filename);
* - $this->exec_module_action('Config', 'write_ini_file', $filename, $config);
* This method reads configuration values in the specified filename.
* This method uses the PHP function parse_ini_file() to load the configuration.
* It always processes sections.
* @param string Name of the file
* @return array An associative array with the configuration
* This method writes the configuration values specified to the filename.
* The file data is overwritten if the file already exists. Implementation
* obtained from the comments under the parse_ini_file() page on PHP.net.
* @param string Name of the file
* @param array Associative array with the configuration
* @return bool Returns true on success, false otherwise
foreach ($config as $key =>
$item) {
$sections .=
"\n[{$key}]\n";
foreach ($item as $key2 =>
$item2) {
$sections .=
"{
$key2} = {
$item2}\n
";
$sections .=
"{
$key2} = \"{
$item2}\"\n
";
$content .=
"{
$key} = {
$item}\n
";
$content .=
"{
$key} = \"{
$item}\"\n
";
if (!$handle =
fopen($filename, 'w'))
if (!fwrite($handle, $content))
Documentation generated on Sat, 23 Jun 2007 21:28:18 -0500 by phpDocumentor 1.3.2