\HTMLPurifier_StringHashParser
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.
Synopsis
class HTMLPurifier_StringHashParser
{
- // members
- public string $default = 'ID';
- // methods
- public void parseFile()
- public void parseMultiFile()
- protected void parseHandle()
Members
public
- $default
Methods
protected
- parseHandle() — Internal parser that acepts a file handle.
public
- parseFile() — Parses a file that contains a single string-hash.
- parseMultiFile() — Parses a file that contains multiple string-hashes delimited by '----'