Detailed Description
InifileConfiguration reads the application configuraiton from ini files.
- Note
- This class only supports ini files with sections.
Definition at line 29 of file InifileConfiguration.php.
Public Member Functions | |
__construct ($configPath) | |
getConfigPath () | |
getConfigurations () | |
addConfiguration ($name, $processValues=true) | |
getSections () | |
hasSection ($section) | |
getSection ($section) | |
hasValue ($key, $section) | |
getValue ($key, $section) | |
getBooleanValue ($key, $section) | |
getDirectoryValue ($key, $section) | |
getFileValue ($key, $section) | |
getKey ($value, $section) | |
isEditable ($section) | |
isModified () | |
createSection ($section) | |
removeSection ($section) | |
renameSection ($oldname, $newname) | |
setValue ($key, $value, $section, $createSection=true) | |
removeKey ($key, $section) | |
renameKey ($oldname, $newname, $section) | |
writeConfiguration ($name) | |
Protected Member Functions | |
processFile ($filename, $configArray=array(), $parsedFiles=array()) | |
_parse_ini_file ($filename) | |
processValues () | |
processValue (&$value) | |
configMerge ($array1, $array2, $override) | |
getConfigIncludes ($array) | |
serialize () | |
unserialize ($parsedFiles) | |
getSerializeFilename ($parsedFiles) | |
checkFileDate ($fileList, $referenceFile) | |
clearAllCache () | |
buildLookupTable () | |
lookup ($section, $key=null) | |
Constructor & Destructor Documentation
__construct | ( | $configPath | ) |
Constructor.
- Parameters
-
$configPath The path, either absolute or relative to the executed script
Definition at line 54 of file InifileConfiguration.php.
Member Function Documentation
getConfigPath | ( | ) |
Get the filesystem path to the configuration files.
- Returns
- The path, either absolute or relative to the executed script
Definition at line 66 of file InifileConfiguration.php.
getConfigurations | ( | ) |
Configuration interface.
Implements Configuration.
Definition at line 77 of file InifileConfiguration.php.
addConfiguration | ( | $name, | |
$processValues = true |
|||
) |
- See also
- Configuration::addConfiguration() Name is the ini file to be parsed (relative to configPath)
- Note
- ini files referenced in section 'config' key 'include' are parsed afterwards
Implements Configuration.
Definition at line 86 of file InifileConfiguration.php.
|
protected |
Process the given file recursivly.
- Parameters
-
$filename The filename $configArray Configuration array $parsedFiles Parsed files
- Returns
- Associative array with keys 'config' (configuration array) and 'files' (array of parsed files)
Definition at line 149 of file InifileConfiguration.php.
getSections | ( | ) |
- See also
- Configuration::getSections()
Implements Configuration.
Definition at line 176 of file InifileConfiguration.php.
hasSection | ( | $section | ) |
- See also
- Configuration::hasSection()
Implements Configuration.
Definition at line 183 of file InifileConfiguration.php.
getSection | ( | $section | ) |
- See also
- Configuration::getSection()
Implements Configuration.
Definition at line 190 of file InifileConfiguration.php.
hasValue | ( | $key, | |
$section | |||
) |
- See also
- Configuration::hasValue()
Implements Configuration.
Definition at line 203 of file InifileConfiguration.php.
getValue | ( | $key, | |
$section | |||
) |
- See also
- Configuration::getValue()
Implements Configuration.
Definition at line 210 of file InifileConfiguration.php.
getBooleanValue | ( | $key, | |
$section | |||
) |
- See also
- Configuration::getBooleanValue()
Implements Configuration.
Definition at line 223 of file InifileConfiguration.php.
getDirectoryValue | ( | $key, | |
$section | |||
) |
Implements Configuration.
Definition at line 231 of file InifileConfiguration.php.
getFileValue | ( | $key, | |
$section | |||
) |
- See also
- Configuration::getFileValue()
Implements Configuration.
Definition at line 248 of file InifileConfiguration.php.
getKey | ( | $value, | |
$section | |||
) |
- See also
- Configuration::getKey()
Implements Configuration.
Definition at line 265 of file InifileConfiguration.php.
isEditable | ( | $section | ) |
WritableConfiguration interface.
Implements WritableConfiguration.
Definition at line 280 of file InifileConfiguration.php.
isModified | ( | ) |
Implements WritableConfiguration.
Definition at line 298 of file InifileConfiguration.php.
createSection | ( | $section | ) |
Implements WritableConfiguration.
Definition at line 305 of file InifileConfiguration.php.
removeSection | ( | $section | ) |
Implements WritableConfiguration.
Definition at line 322 of file InifileConfiguration.php.
renameSection | ( | $oldname, | |
$newname | |||
) |
Implements WritableConfiguration.
Definition at line 337 of file InifileConfiguration.php.
setValue | ( | $key, | |
$value, | |||
$section, | |||
$createSection = true |
|||
) |
Implements WritableConfiguration.
Definition at line 364 of file InifileConfiguration.php.
removeKey | ( | $key, | |
$section | |||
) |
Implements WritableConfiguration.
Definition at line 408 of file InifileConfiguration.php.
renameKey | ( | $oldname, | |
$newname, | |||
$section | |||
) |
Implements WritableConfiguration.
Definition at line 423 of file InifileConfiguration.php.
writeConfiguration | ( | $name | ) |
Implements WritableConfiguration.
Definition at line 453 of file InifileConfiguration.php.
|
protected |
Private interface.
Load in the ini file specified in filename, and return the settings in a multidimensional array, with the section names and settings included. All section names and keys are lowercased.
- Parameters
-
$filename The filename of the ini file to parse
- Returns
- An associative array containing the data
Definition at line 502 of file InifileConfiguration.php.
|
protected |
Process the values in the ini array.
This method turns string values that hold array definitions (comma separated values enclosed by curly brackets) into array values.
Definition at line 548 of file InifileConfiguration.php.
|
protected |
Process the values in the ini array.
This method turns string values that hold array definitions (comma separated values enclosed by curly brackets) into array values.
- Parameters
-
$value A reference to the value
Definition at line 558 of file InifileConfiguration.php.
|
protected |
Merge two arrays, preserving entries in first one unless they are overridden by ones in the second.
- Parameters
-
$array1 First array. $array2 Second array. $override Boolean whether values defined in array1 should be overriden by values defined in array2.
- Returns
- The merged array.
Definition at line 583 of file InifileConfiguration.php.
|
protected |
Search the given value for a 'include' key in a section named 'config' (case-insensivite)
- Parameters
-
$array The array to search in
- Returns
- Mixed
Definition at line 605 of file InifileConfiguration.php.
|
protected |
Store the instance in the filesystem.
If the instance is modified, this call is ignored.
Definition at line 622 of file InifileConfiguration.php.
|
protected |
Retrieve parsed ini data from the filesystem and update the current instance.
If the current instance is modified or the last file given in parsedFiles is newer than the serialized data, this call is ignored. If InifileConfiguration class changed, the call will be ignored as well.
- Parameters
-
$parsedFiles An array of ini filenames that must be contained in the data.
- Returns
- Boolean whether the data could be retrieved or not
Definition at line 646 of file InifileConfiguration.php.
|
protected |
Get the filename for the serialized data that correspond to the the given ini file sequence.
- Parameters
-
$parsedFiles An array of parsed filenames
- Returns
- Filename
Definition at line 678 of file InifileConfiguration.php.
|
protected |
Check if one file in fileList is newer than the referenceFile.
- Parameters
-
$fileList An array of files $referenceFile The file to check against
- Returns
- True, if one of the files is newer, false else
Definition at line 690 of file InifileConfiguration.php.
|
protected |
Clear application cache.
Definition at line 702 of file InifileConfiguration.php.
|
protected |
Build the internal lookup table.
Definition at line 716 of file InifileConfiguration.php.
|
protected |
Lookup section and key.
- Parameters
-
$section The section to lookup $key The key to lookup (optional)
- Returns
- Array with section as first entry and key as second or null if not found
Definition at line 736 of file InifileConfiguration.php.