Public Member Functions | |
dump ($array, $indent=false, $wordwrap=false) | |
Dump PHP array to YAML. | |
_needLiteral ($value) | |
Find out whether a string needs to be output as a literal rather than in plain style. | |
Static Public Member Functions | |
static | YAMLDump ($array, $indent=false, $wordwrap=false) |
Dump YAML from PHP array statically. | |
Private Member Functions | |
_yamlize ($key, $value, $indent) | |
Attempts to convert a key / value array item to YAML. | |
_yamlizeArray ($array, $indent) | |
Attempts to convert an array to YAML. | |
_dumpNode ($key, $value, $indent) | |
Returns YAML from a key and a value. | |
_doLiteralBlock ($value, $indent) | |
Creates a literal block for dumping. | |
_doFolding ($value, $indent) | |
Folds a string of text, if necessary. | |
Private Attributes | |
$_haveRefs | |
$_allNodes | |
$_lastIndent | |
$_lastNode | |
$_inBlock | |
$_isInline | |
$_dumpIndent | |
$_dumpWordWrap |
Definition at line 20 of file ApiFormatYaml_spyc.php.
Spyc::_doFolding | ( | $ | value, | |
$ | indent | |||
) | [private] |
Folds a string of text, if necessary.
$value | The string you wish to fold |
Definition at line 220 of file ApiFormatYaml_spyc.php.
Referenced by _dumpNode().
Spyc::_doLiteralBlock | ( | $ | value, | |
$ | indent | |||
) | [private] |
Creates a literal block for dumping.
$value | ||
$indent | int The value of the indent |
Definition at line 204 of file ApiFormatYaml_spyc.php.
Referenced by _dumpNode().
Spyc::_dumpNode | ( | $ | key, | |
$ | value, | |||
$ | indent | |||
) | [private] |
Returns YAML from a key and a value.
$key | The name of the key | |
$value | The value of the item | |
$indent | The indent of the current node |
Definition at line 172 of file ApiFormatYaml_spyc.php.
References $key, _doFolding(), _doLiteralBlock(), and _needLiteral().
Referenced by _yamlize().
Spyc::_needLiteral | ( | $ | value | ) |
Find out whether a string needs to be output as a literal rather than in plain style.
Added by Roan Kattouw 13-03-2008
$value | The string to check |
Definition at line 153 of file ApiFormatYaml_spyc.php.
Referenced by _dumpNode().
Spyc::_yamlize | ( | $ | key, | |
$ | value, | |||
$ | indent | |||
) | [private] |
Attempts to convert a key / value array item to YAML.
$key | The name of the key | |
$value | The value of the item | |
$indent | The indent of the current node |
Definition at line 113 of file ApiFormatYaml_spyc.php.
References $key, _dumpNode(), and _yamlizeArray().
Referenced by _yamlizeArray(), and dump().
Spyc::_yamlizeArray | ( | $ | array, | |
$ | indent | |||
) | [private] |
Attempts to convert an array to YAML.
$array | The array you want to convert | |
$indent | The indent of the current level |
Definition at line 135 of file ApiFormatYaml_spyc.php.
References $key, and _yamlize().
Referenced by _yamlize().
Spyc::dump | ( | $ | array, | |
$ | indent = false , |
|||
$ | wordwrap = false | |||
) |
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.yml 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.
$array | Array: PHP array | |
$indent | Integer: Pass in false to use the default, which is 2 | |
$wordwrap | Integer: Pass in 0 for no wordwrap, false for default (40) |
Definition at line 66 of file ApiFormatYaml_spyc.php.
References $key, and _yamlize().
static Spyc::YAMLDump | ( | $ | array, | |
$ | indent = false , |
|||
$ | wordwrap = false | |||
) | [static] |
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.yml 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.
$array | Array: PHP array | |
$indent | Integer: Pass in false to use the default, which is 2 | |
$wordwrap | Integer: Pass in 0 for no wordwrap, false for default (40) |
Definition at line 41 of file ApiFormatYaml_spyc.php.
Referenced by ApiFormatYaml::execute().
Spyc::$_allNodes [private] |
Definition at line 96 of file ApiFormatYaml_spyc.php.
Spyc::$_dumpIndent [private] |
Definition at line 101 of file ApiFormatYaml_spyc.php.
Spyc::$_dumpWordWrap [private] |
Definition at line 102 of file ApiFormatYaml_spyc.php.
Spyc::$_haveRefs [private] |
Definition at line 95 of file ApiFormatYaml_spyc.php.
Spyc::$_inBlock [private] |
Definition at line 99 of file ApiFormatYaml_spyc.php.
Spyc::$_isInline [private] |
Definition at line 100 of file ApiFormatYaml_spyc.php.
Spyc::$_lastIndent [private] |
Definition at line 97 of file ApiFormatYaml_spyc.php.
Spyc::$_lastNode [private] |
Definition at line 98 of file ApiFormatYaml_spyc.php.