ILIAS
Release_3_10_x_branch Revision 61812
|
Public Member Functions | |
ilIniFile ($a_ini_file_name) | |
Constructor public. | |
read () | |
read from ini file public | |
parse () | |
load and parse an inifile private | |
parse_data ($a_data) | |
parse data private | |
setContent ($a_data) | |
DESCRIPTION MISSING public. | |
write () | |
save ini-file-data to filesystem private | |
show () | |
returns the content of IniFile public | |
getGroupCount () | |
returns number of groups public | |
readGroups () | |
returns an array with the names of all the groups public | |
groupExists ($a_group_name) | |
checks if a group exists public | |
readGroup ($a_group_name) | |
returns an associative array of the variables in one group public | |
addGroup ($a_group_name) | |
adds a new group public | |
removeGroup ($a_group_name) | |
removes a group public | |
variableExists ($a_group, $a_var_name) | |
returns if a variable exists or not public | |
readVariable ($a_group, $a_var_name) | |
reads a single variable from a group public | |
setVariable ($a_group_name, $a_var_name, $a_var_value) | |
sets a variable in a group public | |
error ($a_errmsg) | |
set error message public | |
getError () | |
returns error public |
Data Fields | |
$INI_FILE_NAME = "" | |
$ERROR = "" | |
$GROUPS = array() | |
$CURRENT_GROUP = "" |
INIFile Parser.
Description:
A Simpe Ini File Implementation to keep settings in a simple file instead of in a DB Based upon class.INIfile.php by Mircho Mirev mirch o@ma cropo int. com
Usage Examples: $ini = new IniFile("./ini.ini"); Read entire group in an associative array $grp = $ini->read_group("MAIN"); //prints the variables in the group if ($grp) for(reset($grp); $key=key($grp); next($grp)) { echo "GROUP ".$key."=".$grp[$key]."<br>"; } //set a variable to a value $ini->setVariable("NEW","USER","JOHN"); //Save the file $ini->save_data();
Definition at line 54 of file class.ilIniFile.php.
ilIniFile::addGroup | ( | $a_group_name | ) |
adds a new group public
string | group name |
Definition at line 335 of file class.ilIniFile.php.
References error(), and groupExists().
ilIniFile::error | ( | $a_errmsg | ) |
set error message public
string |
Definition at line 421 of file class.ilIniFile.php.
Referenced by addGroup(), ilIniFile(), parse(), read(), readGroup(), readVariable(), removeGroup(), setVariable(), and write().
ilIniFile::getError | ( | ) |
returns error public
Definition at line 433 of file class.ilIniFile.php.
References $ERROR.
ilIniFile::getGroupCount | ( | ) |
returns number of groups public
Definition at line 274 of file class.ilIniFile.php.
ilIniFile::groupExists | ( | $a_group_name | ) |
checks if a group exists public
string | group name |
Definition at line 302 of file class.ilIniFile.php.
Referenced by addGroup(), readGroup(), removeGroup(), and setVariable().
ilIniFile::ilIniFile | ( | $a_ini_file_name | ) |
Constructor public.
string | name of file to be parsed |
Definition at line 90 of file class.ilIniFile.php.
References error().
ilIniFile::parse | ( | ) |
load and parse an inifile private
Definition at line 133 of file class.ilIniFile.php.
References error().
Referenced by read().
ilIniFile::parse_data | ( | $a_data | ) |
parse data private
array |
Definition at line 155 of file class.ilIniFile.php.
References $CURRENT_GROUP, and $out.
ilIniFile::read | ( | ) |
read from ini file public
Definition at line 108 of file class.ilIniFile.php.
References error(), and parse().
ilIniFile::readGroup | ( | $a_group_name | ) |
returns an associative array of the variables in one group public
string | group name |
Definition at line 318 of file class.ilIniFile.php.
References error(), and groupExists().
Referenced by show(), and write().
ilIniFile::readGroups | ( | ) |
returns an array with the names of all the groups public
Definition at line 284 of file class.ilIniFile.php.
Referenced by show(), and write().
ilIniFile::readVariable | ( | $a_group, | |
$a_var_name | |||
) |
reads a single variable from a group public
string | group name |
string | value |
Definition at line 385 of file class.ilIniFile.php.
References error().
ilIniFile::removeGroup | ( | $a_group_name | ) |
removes a group public
string | group name |
Definition at line 353 of file class.ilIniFile.php.
References error(), and groupExists().
ilIniFile::setContent | ( | $a_data | ) |
DESCRIPTION MISSING public.
string |
Definition at line 174 of file class.ilIniFile.php.
ilIniFile::setVariable | ( | $a_group_name, | |
$a_var_name, | |||
$a_var_value | |||
) |
sets a variable in a group public
string | |
string | |
string |
Definition at line 404 of file class.ilIniFile.php.
References error(), and groupExists().
ilIniFile::show | ( | ) |
returns the content of IniFile public
Definition at line 235 of file class.ilIniFile.php.
References readGroup(), and readGroups().
ilIniFile::variableExists | ( | $a_group, | |
$a_var_name | |||
) |
returns if a variable exists or not public
string | group name |
string | value |
Definition at line 372 of file class.ilIniFile.php.
ilIniFile::write | ( | ) |
save ini-file-data to filesystem private
Definition at line 185 of file class.ilIniFile.php.
References $res, $result, error(), readGroup(), and readGroups().
ilIniFile::$CURRENT_GROUP = "" |
Definition at line 82 of file class.ilIniFile.php.
Referenced by parse_data().
ilIniFile::$ERROR = "" |
Definition at line 68 of file class.ilIniFile.php.
Referenced by getError().
ilIniFile::$GROUPS = array() |
Definition at line 75 of file class.ilIniFile.php.
ilIniFile::$INI_FILE_NAME = "" |
Definition at line 61 of file class.ilIniFile.php.