|
ILIAS
release_10 Revision v10.1-43-ga1241a92c2f
|
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 mircho@macropoint.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 ". More...
Collaboration diagram for ilIniFile:Public Member Functions | |
| __construct (string $a_ini_file_name) | |
| Constructor. More... | |
| read () | |
| read from ini file More... | |
| parse () | |
| load and parse an inifile More... | |
| write () | |
| save ini-file-data to filesystem More... | |
| show () | |
| returns the content of IniFile More... | |
| getGroupCount () | |
| returns number of groups More... | |
| readGroups () | |
| returns an array with the names of all the groups More... | |
| groupExists (string $a_group_name) | |
| checks if a group exists More... | |
| readGroup (string $a_group_name) | |
| returns an associative array of the variables in one group More... | |
| addGroup (string $a_group_name) | |
| adds a new group More... | |
| removeGroup (string $a_group_name) | |
| removes a group More... | |
| variableExists (string $a_group, string $a_var_name) | |
| returns if a variable exists or not More... | |
| readVariable (string $a_group, string $a_var_name) | |
| reads a single variable from a group More... | |
| setVariable (string $a_group_name, string $a_var_name, string $a_var_value) | |
| sets a variable in a group More... | |
| error (string $a_errmsg) | |
| getError () | |
Data Fields | |
| string | $INI_FILE_NAME = "" |
| name of file More... | |
| string | $ERROR = "" |
| error var More... | |
| array | $GROUPS = array() |
| sections in ini-file More... | |
| string | $CURRENT_GROUP = "" |
| actual section More... | |
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 mircho@macropoint.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 47 of file class.ilIniFile.php.
| ilIniFile::__construct | ( | string | $a_ini_file_name | ) |
Constructor.
Definition at line 72 of file class.ilIniFile.php.
References error().
Here is the call graph for this function:| ilIniFile::addGroup | ( | string | $a_group_name | ) |
adds a new group
Definition at line 249 of file class.ilIniFile.php.
References error(), and groupExists().
Referenced by ilGlobalCacheSettingsAdapter\storeToIniFile().
Here is the call graph for this function:
Here is the caller graph for this function:| ilIniFile::error | ( | string | $a_errmsg | ) |
Definition at line 309 of file class.ilIniFile.php.
Referenced by __construct(), addGroup(), parse(), read(), readGroup(), readVariable(), removeGroup(), setVariable(), and write().
Here is the caller graph for this function:| ilIniFile::getError | ( | ) |
| ilIniFile::getGroupCount | ( | ) |
returns number of groups
Definition at line 202 of file class.ilIniFile.php.
| ilIniFile::groupExists | ( | string | $a_group_name | ) |
checks if a group exists
Definition at line 224 of file class.ilIniFile.php.
Referenced by addGroup(), readGroup(), removeGroup(), and setVariable().
Here is the caller graph for this function:| ilIniFile::parse | ( | ) |
load and parse an inifile
Definition at line 102 of file class.ilIniFile.php.
References Vendor\Package\$e, and error().
Referenced by read().
Here is the call graph for this function:
Here is the caller graph for this function:| ilIniFile::read | ( | ) |
read from ini file
Definition at line 85 of file class.ilIniFile.php.
References error(), and parse().
Here is the call graph for this function:| ilIniFile::readGroup | ( | string | $a_group_name | ) |
returns an associative array of the variables in one group
Definition at line 236 of file class.ilIniFile.php.
References error(), and groupExists().
Referenced by ilGlobalCacheSettingsAdapter\readFromIniFile(), show(), and write().
Here is the call graph for this function:
Here is the caller graph for this function:| ilIniFile::readGroups | ( | ) |
returns an array with the names of all the groups
Definition at line 210 of file class.ilIniFile.php.
References ILIAS\User\Profile\next.
Referenced by show(), and write().
Here is the caller graph for this function:| ilIniFile::readVariable | ( | string | $a_group, |
| string | $a_var_name | ||
| ) |
reads a single variable from a group
Definition at line 285 of file class.ilIniFile.php.
References error().
Referenced by ilTimeZone\initDefaultTimeZone(), and ilGlobalCacheSettingsAdapter\readFromIniFile().
Here is the call graph for this function:
Here is the caller graph for this function:| ilIniFile::removeGroup | ( | string | $a_group_name | ) |
removes a group
Definition at line 263 of file class.ilIniFile.php.
References error(), and groupExists().
Referenced by ilGlobalCacheSettingsAdapter\storeToIniFile().
Here is the call graph for this function:
Here is the caller graph for this function:| ilIniFile::setVariable | ( | string | $a_group_name, |
| string | $a_var_name, | ||
| string | $a_var_value | ||
| ) |
sets a variable in a group
Definition at line 298 of file class.ilIniFile.php.
References error(), and groupExists().
Referenced by ilGlobalCacheSettingsAdapter\storeToIniFile().
Here is the call graph for this function:
Here is the caller graph for this function:| ilIniFile::show | ( | ) |
returns the content of IniFile
Definition at line 170 of file class.ilIniFile.php.
References ILIAS\User\Profile\next, readGroup(), and readGroups().
Here is the call graph for this function:| ilIniFile::variableExists | ( | string | $a_group, |
| string | $a_var_name | ||
| ) |
returns if a variable exists or not
Definition at line 277 of file class.ilIniFile.php.
| ilIniFile::write | ( | ) |
save ini-file-data to filesystem
Definition at line 130 of file class.ilIniFile.php.
References $res, error(), ILIAS\User\Profile\next, readGroup(), and readGroups().
Referenced by ilGlobalCacheSettingsAdapter\storeToIniFile().
Here is the call graph for this function:
Here is the caller graph for this function:| string ilIniFile::$CURRENT_GROUP = "" |
actual section
Definition at line 67 of file class.ilIniFile.php.
| string ilIniFile::$ERROR = "" |
| array ilIniFile::$GROUPS = array() |
sections in ini-file
Definition at line 62 of file class.ilIniFile.php.
| string ilIniFile::$INI_FILE_NAME = "" |
name of file
Definition at line 52 of file class.ilIniFile.php.