ConfigParser Class Reference
[Config]

Class for parsing and modifying php.ini style configuration files. More...

List of all members.

Public Member Functions

 ConfigParser ()
 getFileContents ()
readConfig ($file)
 updateConfig ($file, $params)
 writeConfig ($file)

Public Attributes

 $content


Detailed Description

Class for parsing and modifying php.ini style configuration files.

Definition at line 18 of file ConfigParser.inc.php.


Member Function Documentation

ConfigParser.ConfigParser (  ) 

Constructor.

Definition at line 26 of file ConfigParser.inc.php.

ConfigParser.getFileContents (  ) 

Return the contents of the current config file.

Returns:
string

Definition at line 214 of file ConfigParser.inc.php.

& ConfigParser.readConfig ( file  ) 

Read a configuration file into a multidimensional array. This is a replacement for the PHP parse_ini_file function, which does not type setting values.

Parameters:
$file string full path to the config file
Returns:
array the configuration data (same format as http://php.net/parse_ini_file)

Definition at line 35 of file ConfigParser.inc.php.

Referenced by Config.reloadData().

ConfigParser.updateConfig ( file,
params 
)

Read a configuration file and update variables. This method stores the updated configuration but does not write it out. Use writeConfig() or getFileContents() afterwards to do something with the new config.

Parameters:
$file string full path to the config file
$params array an associative array of configuration parameters to update. If the value is an associative array (of variable name/value pairs) instead of a scalar, the key is treated as a section instead of a variable. Parameters not in $params remain unchanged
Returns:
boolean true if file could be read, false otherwise

Definition at line 132 of file ConfigParser.inc.php.

ConfigParser.writeConfig ( file  ) 

Write contents of current config file

Parameters:
$file string full path to output file
Returns:
boolean file write is successful

Definition at line 193 of file ConfigParser.inc.php.


Member Data Documentation

ConfigParser.$content

Contents of the config file currently being parsed

Definition at line 21 of file ConfigParser.inc.php.


The documentation for this class was generated from the following file:

Generated on Mon Jul 14 10:55:40 2008 for Open Journal Systems by  doxygen 1.5.6