Class: Spyc (4.0.6)
This article describes the class Spyc .
- Location: Part of the module YAML_spyc in the package I2CE 4.0.6-release
- Source: Defined in the file modules/YAML/lib/spyc.php on line 26
- Author: Chris Wanstrath <chris@ozmm.org>
- Author: Vlad Andersen <vlad@oneiros.ru>
Spyc -- A Simple PHP YAML Class @link http://spyc.sourceforge.net/ @copyright Copyright 2005-2006 Chris Wanstrath @license http://www.opensource.org/licenses/mit-license.php MIT License The Simple PHP YAML Class. This class can be used to read a YAML file and convert its contents into a PHP array. It currently supports a very limited subsection of the YAML spec. Usage: $parser = new Spyc; $array = $parser->load($file);
Variables
$_haveRefs
- Defined in i2ce/modules/YAML/lib/spyc.php on line 32
- Type: private $_haveRefs
$_allNodes
- Defined in i2ce/modules/YAML/lib/spyc.php on line 33
- Type: private $_allNodes
$_allParent
- Defined in i2ce/modules/YAML/lib/spyc.php on line 34
- Type: private $_allParent
$_lastIndent
- Defined in i2ce/modules/YAML/lib/spyc.php on line 35
- Type: private $_lastIndent
$_lastNode
- Defined in i2ce/modules/YAML/lib/spyc.php on line 36
- Type: private $_lastNode
$_inBlock
- Defined in i2ce/modules/YAML/lib/spyc.php on line 37
- Type: private $_inBlock
$_isInline
- Defined in i2ce/modules/YAML/lib/spyc.php on line 38
- Type: private $_isInline
$_dumpIndent
- Defined in i2ce/modules/YAML/lib/spyc.php on line 39
- Type: private $_dumpIndent
$_dumpWordWrap
- Defined in i2ce/modules/YAML/lib/spyc.php on line 40
- Type: private $_dumpWordWrap
$_containsGroupAnchor
- Defined in i2ce/modules/YAML/lib/spyc.php on line 41
- Type: private $_containsGroupAnchor
$_containsGroupAlias
- Defined in i2ce/modules/YAML/lib/spyc.php on line 42
- Type: private $_containsGroupAlias
$path
- Defined in i2ce/modules/YAML/lib/spyc.php on line 43
- Type: private $path
$result
- Defined in i2ce/modules/YAML/lib/spyc.php on line 44
- Type: private $result
$LiteralBlockMarkers
- Defined in i2ce/modules/YAML/lib/spyc.php on line 45
- Type: private $LiteralBlockMarkers
$LiteralPlaceHolder
- Defined in i2ce/modules/YAML/lib/spyc.php on line 46
- Type: private $LiteralPlaceHolder
$SavedGroups
- Defined in i2ce/modules/YAML/lib/spyc.php on line 47
- Type: private $SavedGroups
$_nodeId
- Defined in i2ce/modules/YAML/lib/spyc.php on line 53
- Type: public $_nodeId
Methods
YAMLDump()
Dump YAML from PHP array statically The dump method, when supplied with an array, will do its best to convert the array into friendly YAML. Pretty simple. Feel free to save the returned string as nothing.yaml and pass it around. Oh, and you can decide how big the indent is and what the wordwrap for folding is. Pretty cool -- just pass in 'false' for either if you want to use the default. Indent's default is 2 spaces, wordwrap's default is 40 characters. And you can turn off wordwrap by passing in 0. @access public
- Defined in i2ce/modules/YAML/lib/spyc.php on line 95
- Signature: static public function YAMLDump($array,$indent,$wordwrap)
- Parameters:
- Returns: string
YAMLLoad()
Load YAML into a PHP array statically The load method, when supplied with a YAML stream (string or file), will do its best to convert YAML in a file into a PHP array. Pretty simple. Usage: $array = Spyc::YAMLLoad('lucky.yaml'); print_r($array);
@access public
- Defined in i2ce/modules/YAML/lib/spyc.php on line 70
- Signature: static public function YAMLLoad($input)
- Parameters:
- string $input
Path of YAML file or string containing YAML
- string $input
- Returns: array
_doFolding()
Folds a string of text, if necessary @access private
- Defined in i2ce/modules/YAML/lib/spyc.php on line 247
- Signature: private function _doFolding($value,$indent)
- Parameters:
- $value
- $indent
- Returns: string @param $value The string you wish to fold
_doLiteralBlock()
Creates a literal block for dumping @access private
- Defined in i2ce/modules/YAML/lib/spyc.php on line 230
- Signature: private function _doLiteralBlock($value,$indent)
- Parameters:
- $value
- $indent
- Returns: string @param $value @param $indent int The value of the indent
_dumpNode()
Returns YAML from a key and a value @access private
- Defined in i2ce/modules/YAML/lib/spyc.php on line 199
- Signature: private function _dumpNode($key,$value,$indent)
- Parameters:
- $key
- $value
- $indent
- Returns: string @param $key The name of the key @param $value The value of the item @param $indent The indent of the current node
_getIndent()
Finds and returns the indentation of a YAML line @access private
- Defined in i2ce/modules/YAML/lib/spyc.php on line 315
- Signature: private function _getIndent($line)
- Parameters:
- string $line
A line from the YAML file
- string $line
- Returns: int
_inlineEscape()
Used in inlines to check for more inlines or quoted strings @access private
- Defined in i2ce/modules/YAML/lib/spyc.php on line 427
- Signature: private function _inlineEscape($inline)
- Parameters:
- $inline
- Returns: array
_parseLine()
Parses YAML code and returns an array for a node @access private
- Defined in i2ce/modules/YAML/lib/spyc.php on line 327
- Signature: private function _parseLine($line)
- Parameters:
- string $line
A line from the YAML file
- string $line
- Returns: array
_toType()
Finds the type of the passed value, returns the value as the new type. @access private
- Defined in i2ce/modules/YAML/lib/spyc.php on line 359
- Signature: private function _toType($value)
- Parameters:
- string $value
- Returns: mixed
_yamlize()
Attempts to convert a key / value array item to YAML @access private
- Defined in i2ce/modules/YAML/lib/spyc.php on line 156
- Signature: private function _yamlize($key,$value,$indent)
- Parameters:
- $key
- $value
- $indent
- Returns: string @param $key The name of the key @param $value The value of the item @param $indent The indent of the current node
_yamlizeArray()
Attempts to convert an array to YAML @access private
- Defined in i2ce/modules/YAML/lib/spyc.php on line 179
- Signature: private function _yamlizeArray($array,$indent)
- Parameters:
- $array
- $indent
- Returns: string @param $array The array you want to convert @param $indent The indent of the current level
addArray()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 502
- Signature: private function addArray($array,$indent)
- Parameters:
- $array
- $indent
addGroup()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 728
- Signature: private function addGroup($line,$group)
- Parameters:
- $line
- $group
addLiteralLine()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 569
- Signature: private function addLiteralLine($literalBlock,$line,$literalBlockStyle)
- Parameters:
- $literalBlock
- $line
- $literalBlockStyle
clearBiggerPathValues()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 612
- Signature: private function clearBiggerPathValues($indent)
- Parameters:
- $indent
dump()
Dump PHP array to YAML The dump method, when supplied with an array, will do its best to convert the array into friendly YAML. Pretty simple. Feel free to save the returned string as tasteful.yaml and pass it around. Oh, and you can decide how big the indent is and what the wordwrap for folding is. Pretty cool -- just pass in 'false' for either if you want to use the default. Indent's default is 2 spaces, wordwrap's default is 40 characters. And you can turn off wordwrap by passing in 0. @access public
- Defined in i2ce/modules/YAML/lib/spyc.php on line 121
- Signature: public function dump($array,$indent,$wordwrap)
- Parameters:
- Returns: string
flatten()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 547
- Signature: private function flatten($array)
- Parameters:
- $array
getParentPathByIndent()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 599
- Signature: private function getParentPathByIndent($indent)
- Parameters:
- $indent
isArrayElement()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 631
- Signature: private function isArrayElement($line)
- Parameters:
- $line
isComment()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 626
- Signature: private function isComment($line)
- Parameters:
- $line
isHashElement()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 640
- Signature: private function isHashElement($line)
- Parameters:
- $line
isLiteral()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 648
- Signature: private function isLiteral($line)
- Parameters:
- $line
literalBlockContinues()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 496
- Signature: private function literalBlockContinues($line,$lineIndent)
- Parameters:
- $line
- $lineIndent
load()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 264
- Signature: private function load($input)
- Parameters:
- $input
loadFromSource()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 297
- Signature: private function loadFromSource($input)
- Parameters:
- $input
nodeContainsGroup()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 719
- Signature: private function nodeContainsGroup($line)
- Parameters:
- $line
returnArrayElement()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 709
- Signature: private function returnArrayElement($line)
- Parameters:
- $line
returnKeyValuePair()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 677
- Signature: private function returnKeyValuePair($line)
- Parameters:
- $line
returnMappedSequence()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 659
- Signature: private function returnMappedSequence($line)
- Parameters:
- $line
returnMappedValue()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 666
- Signature: private function returnMappedValue($line)
- Parameters:
- $line
revertLiteralPlaceHolder()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 585
- Signature: private function revertLiteralPlaceHolder($lineArray,$literalBlock)
- Parameters:
- $lineArray
- $literalBlock
startsLiteralBlock()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 562
- Signature: private function startsLiteralBlock($line)
- Parameters:
- $line
startsMappedSequence()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 655
- Signature: private function startsMappedSequence($line)
- Parameters:
- $line
startsMappedValue()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 673
- Signature: private function startsMappedValue($line)
- Parameters:
- $line
stripGroup()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 734
- Signature: private function stripGroup($line,$group)
- Parameters:
- $line
- $group
stripIndent()
- Defined in i2ce/modules/YAML/lib/spyc.php on line 594
- Signature: private function stripIndent($line,$indent)
- Parameters:
- $line
- $indent
- Default Value: -1