ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Public Member Functions | |
__construct ($a_ini_file_name) | |
Constructor public. More... | |
read () | |
read from ini file public More... | |
parse () | |
load and parse an inifile private More... | |
fixIniFile () | |
Fix ini file (make it compatible for PHP 5.3) More... | |
write () | |
save ini-file-data to filesystem private More... | |
show () | |
returns the content of IniFile public More... | |
getGroupCount () | |
returns number of groups public More... | |
readGroups () | |
returns an array with the names of all the groups public More... | |
groupExists ($a_group_name) | |
checks if a group exists public More... | |
readGroup ($a_group_name) | |
returns an associative array of the variables in one group public More... | |
addGroup ($a_group_name) | |
adds a new group public More... | |
removeGroup ($a_group_name) | |
removes a group public More... | |
variableExists ($a_group, $a_var_name) | |
returns if a variable exists or not public More... | |
readVariable ($a_group, $a_var_name) | |
reads a single variable from a group public More... | |
setVariable ($a_group_name, $a_var_name, $a_var_value) | |
sets a variable in a group public More... | |
error ($a_errmsg) | |
set error message public More... | |
getError () | |
returns error public More... | |
Data Fields | |
$INI_FILE_NAME = "" | |
$ERROR = "" | |
$GROUPS = array() | |
$CURRENT_GROUP = "" | |
INIFile Parser.
Early access in init proceess! Avoid further dependencies like logging or other services
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 37 of file class.ilIniFile.php.
ilIniFile::__construct | ( | $a_ini_file_name | ) |
Constructor public.
string | name of file to be parsed |
Definition at line 73 of file class.ilIniFile.php.
References error().
ilIniFile::addGroup | ( | $a_group_name | ) |
adds a new group public
string | group name |
Definition at line 313 of file class.ilIniFile.php.
References error(), and groupExists().
Referenced by ilGlobalCacheSettings\checkIniHeader(), and ilGlobalCacheSettings\writeToIniFile().
ilIniFile::error | ( | $a_errmsg | ) |
set error message public
string |
Definition at line 395 of file class.ilIniFile.php.
Referenced by __construct(), addGroup(), parse(), read(), readGroup(), readVariable(), removeGroup(), setVariable(), and write().
ilIniFile::fixIniFile | ( | ) |
Fix ini file (make it compatible for PHP 5.3)
Definition at line 136 of file class.ilIniFile.php.
References $l.
Referenced by parse().
ilIniFile::getError | ( | ) |
returns error public
Definition at line 407 of file class.ilIniFile.php.
References $ERROR.
ilIniFile::getGroupCount | ( | ) |
ilIniFile::groupExists | ( | $a_group_name | ) |
checks if a group exists public
string | group name |
Definition at line 282 of file class.ilIniFile.php.
Referenced by addGroup(), readGroup(), removeGroup(), and setVariable().
ilIniFile::parse | ( | ) |
load and parse an inifile private
Definition at line 111 of file class.ilIniFile.php.
References error(), and fixIniFile().
Referenced by read().
ilIniFile::read | ( | ) |
read from ini file public
Definition at line 90 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 297 of file class.ilIniFile.php.
References error(), and groupExists().
Referenced by ilGlobalCacheSettings\checkIniHeader(), ilGlobalCacheSettings\readFromIniFile(), show(), and write().
ilIniFile::readGroups | ( | ) |
returns an array with the names of all the groups public
Definition at line 265 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 361 of file class.ilIniFile.php.
References error().
Referenced by ilTimeZone\initDefaultTimeZone(), and ilGlobalCacheSettings\readFromIniFile().
ilIniFile::removeGroup | ( | $a_group_name | ) |
removes a group public
string | group name |
Definition at line 330 of file class.ilIniFile.php.
References error(), and groupExists().
Referenced by ilGlobalCacheSettings\writeToIniFile().
ilIniFile::setVariable | ( | $a_group_name, | |
$a_var_name, | |||
$a_var_value | |||
) |
sets a variable in a group public
string | |
string | |
string |
Definition at line 379 of file class.ilIniFile.php.
References error(), and groupExists().
Referenced by ilGlobalCacheSettings\writeToIniFile().
ilIniFile::show | ( | ) |
returns the content of IniFile public
Definition at line 221 of file class.ilIniFile.php.
References $i, $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 348 of file class.ilIniFile.php.
ilIniFile::write | ( | ) |
save ini-file-data to filesystem private
Definition at line 177 of file class.ilIniFile.php.
References $i, $key, $res, $result, error(), readGroup(), and readGroups().
Referenced by ilGlobalCacheSettings\writeToIniFile().
ilIniFile::$CURRENT_GROUP = "" |
Definition at line 65 of file class.ilIniFile.php.
ilIniFile::$ERROR = "" |
Definition at line 51 of file class.ilIniFile.php.
Referenced by getError().
ilIniFile::$GROUPS = array() |
Definition at line 58 of file class.ilIniFile.php.
ilIniFile::$INI_FILE_NAME = "" |
Definition at line 44 of file class.ilIniFile.php.