|
ILIAS
release_5-0 Revision 5.0.0-1144-gc4397b1f870
|
Parses string hash files. More...
Collaboration diagram for HTMLPurifier_StringHashParser:Public Member Functions | |
| parseFile ($file) | |
| Parses a file that contains a single string-hash. More... | |
| parseMultiFile ($file) | |
| Parses a file that contains multiple string-hashes delimited by '-—'. More... | |
Data Fields | |
| $default = 'ID' | |
| @type string More... | |
Protected Member Functions | |
| parseHandle ($fh) | |
| Internal parser that acepts a file handle. More... | |
Parses string hash files.
File format is as such:
DefaultKeyValue KEY: Value KEY2: Value2 --MULTILINE-KEY-- Multiline value.
Which would output something similar to:
array(
'ID' => 'DefaultKeyValue',
'KEY' => 'Value',
'KEY2' => 'Value2',
'MULTILINE-KEY' => "Multiline\nvalue.\n",
)
We use this as an easy to use file-format for configuration schema files, but the class itself is usage agnostic.
You can use -— to forcibly terminate parsing of a single string-hash; this marker is used in multi string-hashes to delimit boundaries.
Definition at line 28 of file StringHashParser.php.
| HTMLPurifier_StringHashParser::parseFile | ( | $file | ) |
Parses a file that contains a single string-hash.
| string | $file |
Definition at line 41 of file StringHashParser.php.
References $file, $ret, and parseHandle().
Here is the call graph for this function:
|
protected |
Internal parser that acepts a file handle.
| resource | $fh | File handle with pointer at start of valid string-hash block. |
Definition at line 86 of file StringHashParser.php.
References $default, and $ret.
Referenced by parseFile(), and parseMultiFile().
Here is the caller graph for this function:| HTMLPurifier_StringHashParser::parseMultiFile | ( | $file | ) |
Parses a file that contains multiple string-hashes delimited by '-—'.
| string | $file |
Definition at line 60 of file StringHashParser.php.
References $file, $ret, and parseHandle().
Here is the call graph for this function:| HTMLPurifier_StringHashParser::$default = 'ID' |