Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
ConfigParser Class Reference

Public Member Functions

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

Public Attributes


Detailed Description

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

Definition at line 17 of file

Member Function Documentation

ConfigParser::ConfigParser ( )


Definition at line 25 of file

ConfigParser::getFileContents ( )

Return the contents of the current config file.


Definition at line 213 of file

References $content.

& 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.

$filestring full path to the config file
array the configuration data (same format as

Definition at line 34 of file

Referenced by Config\reloadData().

ConfigParser::updateConfig (   $file,

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.

$filestring full path to the config file
$paramsarray 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
boolean true if file could be read, false otherwise

Definition at line 131 of file

ConfigParser::writeConfig (   $file)

Write contents of current config file

$filestring full path to output file
boolean file write is successful

Definition at line 192 of file

Member Data Documentation


Contents of the config file currently being parsed

Definition at line 20 of file

Referenced by getFileContents().

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