Class Horde_Yaml_Loader

Description

Parse YAML strings into PHP data structures

Located in /Yaml/lib/Horde/Yaml/Loader.php (line 23)


	
			
Variable Summary
 array $_allNodes
 array $_allParent
 array $_haveRefs
 boolean $_inBlock
 boolean $_isInline
 integer $_lastIndent
 integer $_lastNode
 integer $_lineNumber
 integer $_nodeId
Method Summary
 Horde_Yaml_Loader __construct ()
 Horde_Yaml_Node parse (string $line)
 array toArray ()
 array _array_kmerge (array $arr1, array $arr2)
 array _buildArray ()
 array _gatherChildren (int $nid)
 int _getIndent (string $line)
 array _inlineEscape (string $inline)
 void _linkRef ( &$n,  $key, [string $k = null], [mixed $v = null], Horde_Yaml_Node $n)
 bool _linkReferences ()
 bool _makeReferences ( &$z, Horde_Yaml_Node $z)
 boolean _nodeArrayizeData ( &$node, array $node)
 array _parseLine (string $line)
 mixed _toType (string $value)
 void _unserialize (string &$data)
Variables
array $_allNodes = array() (line 35)

All nodes

  • access: protected
array $_allParent = array() (line 41)

Array of node parents

  • access: protected
array $_haveRefs = array() (line 29)

List of nodes with references

  • access: protected
boolean $_inBlock = false (line 59)

Is the parser inside a block?

  • access: protected
boolean $_isInline = false (line 64)
  • access: protected
integer $_lastIndent = 0 (line 47)

Last indent level

  • access: protected
integer $_lastNode = null (line 53)

Last node id

  • access: protected
integer $_lineNumber = 0 (line 76)

Last line number parsed.

  • access: protected
integer $_nodeId = 1 (line 70)

Next node id to use

  • access: protected
Methods
Constructor __construct (line 81)

Create a new YAML parser.

  • access: public
Horde_Yaml_Loader __construct ()
parse (line 109)

Parse a line of a YAML file.

  • return: YAML Node
  • access: public
Horde_Yaml_Node parse (string $line)
  • string $line: The line of YAML to parse.
toArray (line 93)

Return the PHP built from all YAML parsed so far.

  • return: PHP version of parsed YAML
  • access: public
array toArray ()
_array_kmerge (line 738)

Merges two arrays, maintaining numeric keys. If two numeric keys clash, the second one will be appended to the resulting array. If string keys clash, the last one wins.

  • access: protected
array _array_kmerge (array $arr1, array $arr2)
  • array $arr1
  • array $arr2
_buildArray (line 538)

Builds the PHP array from all the YAML nodes we've gathered

  • access: protected
array _buildArray ()
_gatherChildren (line 630)

Finds the children of a node and aids in the building of the PHP array

  • access: protected
array _gatherChildren (int $nid)
  • int $nid: The id of the node whose children we're gathering
_getIndent (line 252)

Finds and returns the indentation of a YAML line

  • return: Indentation level
  • access: protected
int _getIndent (string $line)
  • string $line: A line from the YAML file
_inlineEscape (line 471)

Used in inlines to check for more inlines or quoted strings

  • todo: There should be a cleaner way to do this. While pure sequences seem to be nesting just fine, pure mappings and mappings with sequences inside can't go very deep. This needs to be fixed.
  • access: protected
array _inlineEscape (string $inline)
  • string $inline: Inline data
_linkRef (line 594)

Helper for _linkReferences()

void _linkRef ( &$n,  $key, [string $k = null], [mixed $v = null], Horde_Yaml_Node $n)
_linkReferences (line 565)

Traverses node-space and sets references (& and *) accordingly

  • access: protected
bool _linkReferences ()
_makeReferences (line 710)

Traverses node-space and copies references to / from this object.

  • access: protected
bool _makeReferences ( &$z, Horde_Yaml_Node $z)
_nodeArrayizeData (line 658)

Turns a node's data and its children's data into a PHP array

  • access: protected
boolean _nodeArrayizeData ( &$node, array $node)
  • array $node: The node which you want to arrayize
  • &$node
_parseLine (line 267)

Parses YAML code and returns an array for a node

  • access: protected
array _parseLine (string $line)
  • string $line: A line from the YAML file
_toType (line 315)

Finds the type of the passed value, returns the value as the new type.

  • access: protected
mixed _toType (string $value)
  • string $value
_unserialize (line 400)

Handle PHP serialized data.

  • access: protected
void _unserialize (string &$data)
  • string &$data: Data to check for serialized PHP types.

Documentation generated on Sun, 30 Jan 2011 05:19:18 +0000 by phpDocumentor 1.4.3