PHP Class HTMLPurifier_StringHashParser, yii

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.
Mostra file Open project: yiisoft/yii Class Usage Examples

Public Properties

Property Type Description
$default

Public Methods

Method Description
parseFile ( string $file ) : array Parses a file that contains a single string-hash.
parseMultiFile ( string $file ) : array Parses a file that contains multiple string-hashes delimited by '----'

Protected Methods

Method Description
parseHandle ( resource $fh ) : array Internal parser that acepts a file handle.

Method Details

parseFile() public method

Parses a file that contains a single string-hash.
public parseFile ( string $file ) : array
$file string
return array

parseHandle() protected method

Internal parser that acepts a file handle.
protected parseHandle ( resource $fh ) : array
$fh resource File handle with pointer at start of valid string-hash block.
return array

parseMultiFile() public method

Parses a file that contains multiple string-hashes delimited by '----'
public parseMultiFile ( string $file ) : array
$file string
return array

Property Details

$default public_oe property

public $default