\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.

Summary

Methods
Properties
Constants
parseFile()
parseMultiFile()
$default
No constants found
parseHandle()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$default

$default

Methods

parseFile()

parseFile(string  $file) : array

Parses a file that contains a single string-hash.

Parameters

string $file

Returns

array —

parseMultiFile()

parseMultiFile(string  $file) : array

Parses a file that contains multiple string-hashes delimited by '----'

Parameters

string $file

Returns

array —

parseHandle()

parseHandle(resource  $fh) : array

Internal parser that acepts a file handle.

Parameters

resource $fh

File handle with pointer at start of valid string-hash block.

Returns

array —