HTMLPurifier 4.4.0
|
Parses string hash files. More...
Public Member Functions | |
parseFile ($file) | |
Parses a file that contains a single string-hash. | |
parseMultiFile ($file) | |
Parses a file that contains multiple string-hashes delimited by '----'. | |
parseFile ($file) | |
Parses a file that contains a single string-hash. | |
parseMultiFile ($file) | |
Parses a file that contains multiple string-hashes delimited by '----'. | |
Public Attributes | |
$default = 'ID' | |
Protected Member Functions | |
parseHandle ($fh) | |
Internal parser that acepts a file handle. | |
parseHandle ($fh) | |
Internal parser that acepts a file handle. |
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.
Definition at line 36 of file StringHashParser.php.
References parseHandle().
HTMLPurifier_StringHashParser::parseFile | ( | $ | file | ) |
Parses a file that contains a single string-hash.
Definition at line 6842 of file HTMLPurifier.standalone.php.
References parseHandle().
HTMLPurifier_StringHashParser::parseHandle | ( | $ | fh | ) | [protected] |
Internal parser that acepts a file handle.
$fh | File handle with pointer at start of valid string-hash block. |
Definition at line 6874 of file HTMLPurifier.standalone.php.
HTMLPurifier_StringHashParser::parseHandle | ( | $ | fh | ) | [protected] |
Internal parser that acepts a file handle.
$fh | File handle with pointer at start of valid string-hash block. |
Definition at line 68 of file StringHashParser.php.
Referenced by parseFile(), and parseMultiFile().
HTMLPurifier_StringHashParser::parseMultiFile | ( | $ | file | ) |
Parses a file that contains multiple string-hashes delimited by '----'.
Definition at line 48 of file StringHashParser.php.
References parseHandle().
HTMLPurifier_StringHashParser::parseMultiFile | ( | $ | file | ) |
Parses a file that contains multiple string-hashes delimited by '----'.
Definition at line 6854 of file HTMLPurifier.standalone.php.
References parseHandle().
HTMLPurifier_StringHashParser::$default = 'ID' |
Definition at line 31 of file StringHashParser.php.