ILIAS
Release_4_0_x_branch Revision 61816
|
Public Member Functions | |
ilIniFile ($a_ini_file_name) | |
Constructor public. | |
read () | |
read from ini file public | |
parse () | |
load and parse an inifile private | |
fixIniFile () | |
Fix ini file (make it compatible for PHP 5.3) | |
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 34 of file class.ilIniFile.php.
ilIniFile::addGroup | ( | $a_group_name | ) |
adds a new group public
string | group name |
Definition at line 369 of file class.ilIniFile.php.
References error(), and groupExists().
ilIniFile::error | ( | $a_errmsg | ) |
set error message public
string |
Definition at line 455 of file class.ilIniFile.php.
Referenced by addGroup(), ilIniFile(), parse(), read(), readGroup(), readVariable(), removeGroup(), setVariable(), and write().
ilIniFile::fixIniFile | ( | ) |
Fix ini file (make it compatible for PHP 5.3)
Definition at line 141 of file class.ilIniFile.php.
Referenced by parse().
ilIniFile::getError | ( | ) |
returns error public
Definition at line 467 of file class.ilIniFile.php.
References $ERROR.
ilIniFile::getGroupCount | ( | ) |
returns number of groups public
Definition at line 308 of file class.ilIniFile.php.
ilIniFile::groupExists | ( | $a_group_name | ) |
checks if a group exists public
string | group name |
Definition at line 336 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 70 of file class.ilIniFile.php.
References error().
ilIniFile::parse | ( | ) |
load and parse an inifile private
Definition at line 113 of file class.ilIniFile.php.
References error(), and fixIniFile().
Referenced by read().
ilIniFile::parse_data | ( | $a_data | ) |
parse data private
array |
Definition at line 189 of file class.ilIniFile.php.
References $CURRENT_GROUP, $out, and elseif().
ilIniFile::read | ( | ) |
read from ini file public
Definition at line 88 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 352 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 318 of file class.ilIniFile.php.
References $key.
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 419 of file class.ilIniFile.php.
References error().
ilIniFile::removeGroup | ( | $a_group_name | ) |
removes a group public
string | group name |
Definition at line 387 of file class.ilIniFile.php.
References error(), and groupExists().
ilIniFile::setContent | ( | $a_data | ) |
DESCRIPTION MISSING public.
string |
Definition at line 208 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 438 of file class.ilIniFile.php.
References error(), and groupExists().
ilIniFile::show | ( | ) |
returns the content of IniFile public
Definition at line 269 of file class.ilIniFile.php.
References $key, 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 406 of file class.ilIniFile.php.
ilIniFile::write | ( | ) |
save ini-file-data to filesystem private
Definition at line 219 of file class.ilIniFile.php.
References $key, $res, $result, error(), readGroup(), and readGroups().
ilIniFile::$CURRENT_GROUP = "" |
Definition at line 62 of file class.ilIniFile.php.
Referenced by parse_data().
ilIniFile::$ERROR = "" |
Definition at line 48 of file class.ilIniFile.php.
Referenced by getError().
ilIniFile::$GROUPS = array() |
Definition at line 55 of file class.ilIniFile.php.
ilIniFile::$INI_FILE_NAME = "" |
Definition at line 41 of file class.ilIniFile.php.