wCMF
3.6
|
Public Member Functions | |
& | getInstance () |
getErrorMsg () | |
isModified () | |
parseIniFile ($filename, $processValues=true) | |
getData () | |
getSections () | |
getSection ($section) | |
getValue ($key, $section) | |
setData ($data) | |
isHidden ($section) | |
isEditable ($section) | |
createSection ($section) | |
removeSection ($section) | |
renameSection ($oldname, $newname) | |
setValue ($key, $value, $section, $createSection=true) | |
removeKey ($key, $section) | |
renameKey ($oldname, $newname, $section) | |
writeIniFile ($filename=null) | |
_parse_ini_file ($filename) | |
processValues () | |
processValue (&$value) | |
configMerge ($array1, $array2, $override) | |
serialize () | |
unserialize ($parsedFiles) | |
getSerializeFilename ($parsedFiles) | |
checkFileDate ($fileList, $referenceFile) | |
Public Attributes | |
$_errorMsg = '' | |
$_filename = null | |
$_iniArray = array() | |
$_comments = array() | |
$_isModified = false | |
$_parsedFiles = array() | |
$_useCache = true | |
InifileParser provides basic services for parsing a ini file from the file system.
wCMF - wemove Content Management Framework Copyright (C) 2005-2014 wemove digital solutions GmbH
Licensed under the terms of any of the following licenses at your choice:
See the license.txt file distributed with this work for additional information.
Definition at line 31 of file class.InifileParser.php.
& InifileParser::getInstance | ( | ) |
InifileParser public readonly Interface Returns an instance of the class.
Definition at line 51 of file class.InifileParser.php.
Referenced by RPCClient\__construct(), RightsManager\activate(), Controller\assignViewDefaults(), DefaultControlRenderer\configure_color(), DefaultControlRenderer\configure_fckeditor(), DefaultControlRenderer\configure_fileex(), ObjectFactory\createInstanceFromConfig(), I18nUtil\createPOFile(), RightsManager\deactivate(), CreateInstanceController\executeKernel(), DisplayController\executeKernel(), DBUtil\executeScript(), g_getBackupNames(), Message\get(), get_path(), Message\getAll(), BackupController\getBackupDir(), CreateInstanceController\getBaseLocation(), LinkConverter\getBaseUrl(), WCMFInifileParser\getBestActionKey(), AuthUser\getClassDefinitionFiles(), ObjectFactory\getClassfileFromConfig(), RemotingFacade\getClient(), MySQLBackupController\getConnectionParameters(), WCMFInifileParser\getData(), Localization\getDefaultLanguage(), WCMFInifileParser\getErrorMsg(), PageExportController\getExportDir(), SaveController\getImageConstraints(), Localization\getIncludedInputTypes(), SearchUtil\getIndexPath(), FormUtil\getInputFieldDelimiter(), WCMFInifileParser\getInstance(), LockManager\getInstance(), PersistenceFacade\getKnownTypes(), FormUtil\getListMap(), LockManagerRDB\getLockImpl(), PersistenceFacadeImpl\getMapper(), DefaultControlRenderer\getMaxFileSize(), CreateInstanceController\getNewInstanceDatabase(), SimplePagingController\getOIDs(), RemotingFacade\getRemoteUser(), ResourceListController\getResourceBaseDir(), UserManager\getRoleClassName(), TreeViewController\getRootOIDs(), WCMFInifileParser\getSection(), WCMFInifileParser\getSections(), Localization\getSupportedLanguages(), CopyController\getTargetMapper(), Localization\getTranslationType(), SaveController\getUploadDir(), UserManager\getUserClassName(), AuthUserRDB\getUserData(), WCMFInifileParser\getValue(), XMLExportController\initExport(), LoginController\initialize(), SearchUtil\isActivated(), RightsManager\isAnonymous(), ObjectFactory\loadClassDefinitionFromConfig(), AuthUser\login(), NodeToSingleTableMapper\NodeToSingleTableMapper(), UserManagerRDB\openConnection(), WCMFInifileParser\parseIniFile(), DefaultControlRenderer\renderControl(), DefaultValueRenderer\renderValue(), SaveController\saveUploadFile(), View\setup(), smarty_function_configvalue(), SOAPController\soapSearch(), FileUtil\uploadFile(), and UserManager\UserManager().
InifileParser::getErrorMsg | ( | ) |
Returns the errorMsg.
Definition at line 65 of file class.InifileParser.php.
References $_errorMsg.
InifileParser::isModified | ( | ) |
Check if file is modified.
Definition at line 74 of file class.InifileParser.php.
References $_isModified.
Referenced by serialize(), and unserialize().
InifileParser::parseIniFile | ( | $filename, | |
$processValues = true |
|||
) |
Parses an ini file and puts an array with all the key-values pairs into the object.
filename | The filename of the ini file to parse |
processValues | True/False whether values should be processed after parsing (e.g. make arrays) [default: true] |
Definition at line 86 of file class.InifileParser.php.
References $_parsedFiles, _parse_ini_file(), configMerge(), getValue(), processValue(), processValues(), serialize(), and unserialize().
InifileParser::getData | ( | ) |
Returns the data of the formerly parsed ini file.
Definition at line 135 of file class.InifileParser.php.
References $_iniArray.
InifileParser::getSections | ( | ) |
Get all section names.
Definition at line 144 of file class.InifileParser.php.
InifileParser::getSection | ( | $section | ) |
Get a section.
section | The section to return (case insensitive). |
Definition at line 155 of file class.InifileParser.php.
References ArrayUtil\get_matching_values_i().
Referenced by createSection(), getValue(), removeSection(), renameSection(), and setValue().
InifileParser::getValue | ( | $key, | |
$section | |||
) |
Get a value from the formerly parsed ini file.
key | The name of the entry (case insensitive). |
section | The section the key belongs to (case insensitive). |
Definition at line 178 of file class.InifileParser.php.
References ArrayUtil\get_matching_values_i(), and getSection().
Referenced by isEditable(), isHidden(), parseIniFile(), removeKey(), and renameKey().
InifileParser::setData | ( | $data | ) |
InifileParser public modification Interface Set ini file data.
data | The ini file data. |
Definition at line 206 of file class.InifileParser.php.
InifileParser::isHidden | ( | $section | ) |
Check if a section is hidden.
section | The name of the section. |
Definition at line 217 of file class.InifileParser.php.
References getValue(), and processValue().
InifileParser::isEditable | ( | $section | ) |
Check if a section is editable.
section | The name of the section. |
Definition at line 233 of file class.InifileParser.php.
References getValue(), and processValue().
Referenced by removeKey(), removeSection(), renameKey(), renameSection(), and setValue().
InifileParser::createSection | ( | $section | ) |
Create a section.
section | The name of the section (will be trimmed). |
Definition at line 249 of file class.InifileParser.php.
References getSection().
InifileParser::removeSection | ( | $section | ) |
Remove a section.
section | The name of the section. |
Definition at line 272 of file class.InifileParser.php.
References getSection(), and isEditable().
InifileParser::renameSection | ( | $oldname, | |
$newname | |||
) |
Rename a section.
oldname | The name of the section. |
newname | The new name of the section (will be trimmed). |
Definition at line 292 of file class.InifileParser.php.
References getSection(), isEditable(), and ArrayUtil\key_array_rename().
InifileParser::setValue | ( | $key, | |
$value, | |||
$section, | |||
$createSection = true |
|||
) |
Create a key/value pair in a section.
key | The name of the key (will be trimmed). |
value | The value of the key. |
section | The name of the section. |
createSection | The name of the section. |
Definition at line 325 of file class.InifileParser.php.
References getSection(), and isEditable().
InifileParser::removeKey | ( | $key, | |
$section | |||
) |
Remove a key from a section.
key | The name of the key. |
section | The name of the section. |
Definition at line 351 of file class.InifileParser.php.
References getValue(), and isEditable().
InifileParser::renameKey | ( | $oldname, | |
$newname, | |||
$section | |||
) |
Rename a key in a section.
oldname | The name of the section. |
newname | The new name of the section (will be trimmed). |
section | The name of the section. |
Definition at line 372 of file class.InifileParser.php.
References getValue(), isEditable(), and ArrayUtil\key_array_rename().
InifileParser::writeIniFile | ( | $filename = null | ) |
Write the ini data to a file.
filename | The filename to write to, if null the original file will be used [default: null]. |
Definition at line 402 of file class.InifileParser.php.
References $_filename.
InifileParser::_parse_ini_file | ( | $filename | ) |
InifileParser 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.
filename | The filename of the ini file to parse |
Definition at line 459 of file class.InifileParser.php.
References WCMFException\throwEx().
Referenced by parseIniFile().
InifileParser::processValues | ( | ) |
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 511 of file class.InifileParser.php.
Referenced by parseIniFile().
InifileParser::processValue | ( | & | $value | ) |
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.
value | A reference to the value |
Definition at line 523 of file class.InifileParser.php.
References StringUtil\quotesplit().
Referenced by isEditable(), isHidden(), and parseIniFile().
InifileParser::configMerge | ( | $array1, | |
$array2, | |||
$override | |||
) |
Merge two arrays, preserving entries in first one unless they are overridden by ones in the second.
array1 | First array. |
array2 | Second array. |
override | True/False whether values defined in array1 should be overriden by values defined in array2. |
Definition at line 549 of file class.InifileParser.php.
Referenced by parseIniFile().
InifileParser::serialize | ( | ) |
Store the instance in the filesystem. If the instance is modified, this call is ignored.
Definition at line 569 of file class.InifileParser.php.
References getSerializeFilename(), and isModified().
Referenced by parseIniFile().
InifileParser::unserialize | ( | $parsedFiles | ) |
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 seriralized data, this call is ignored.
parsedFiles | An array of ini filenames that must be contained in the data. |
True/False | wether the data could be retrieved or not |
Definition at line 591 of file class.InifileParser.php.
References checkFileDate(), getSerializeFilename(), and isModified().
Referenced by parseIniFile().
InifileParser::getSerializeFilename | ( | $parsedFiles | ) |
Get the filename for the serialized data that correspond to the the given ini file sequence.
parsedFiles | An array of parsed filenames |
Definition at line 635 of file class.InifileParser.php.
Referenced by serialize(), and unserialize().
InifileParser::checkFileDate | ( | $fileList, | |
$referenceFile | |||
) |
Check if one file in fileList is newer than the referenceFile.
fileList | An array of files |
referenceFile | The file to check against |
Definition at line 649 of file class.InifileParser.php.
Referenced by unserialize().
InifileParser::$_errorMsg = '' |
Definition at line 33 of file class.InifileParser.php.
Referenced by getErrorMsg().
InifileParser::$_filename = null |
Definition at line 34 of file class.InifileParser.php.
Referenced by writeIniFile().
InifileParser::$_iniArray = array() |
Definition at line 35 of file class.InifileParser.php.
Referenced by getData().
InifileParser::$_comments = array() |
Definition at line 36 of file class.InifileParser.php.
InifileParser::$_isModified = false |
Definition at line 39 of file class.InifileParser.php.
Referenced by isModified().
InifileParser::$_parsedFiles = array() |
Definition at line 40 of file class.InifileParser.php.
Referenced by parseIniFile().
InifileParser::$_useCache = true |
Definition at line 41 of file class.InifileParser.php.