Horde_Yaml_Dumper
in package
Dump PHP data structures to YAML.
Tags
Table of Contents
- $_options : mixed
- dump() : string
- Dumps PHP array to YAML.
- _doLiteralBlock() : string
- Creates a literal block for dumping.
- _dumpNode() : string
- Returns YAML from a key and a value.
- _fold() : string
- Folds a string of text, if necessary.
- _yamlize() : string
- Attempts to convert a key/value array item to YAML.
- _yamlizeArray() : string
- Attempts to convert an array to YAML
Properties
$_options
protected
mixed
$_options
= array()
Methods
dump()
Dumps PHP array to YAML.
public
dump(mixed $value[, int $options = array() ]) : string
The dump method, when supplied with an array, will do its best to convert the array into valid YAML.
Options:
indent
:
number of spaces to indent children (default 2)
wordwrap
:
wordwrap column number (default 40)
Parameters
- $value : mixed
- $options : int = array()
-
Options for dumping.
Return values
string —YAML representation of $value.
_doLiteralBlock()
Creates a literal block for dumping.
protected
_doLiteralBlock(string $value, int $indent) : string
Parameters
- $value : string
- $indent : int
-
The value of the indent.
Return values
string —_dumpNode()
Returns YAML from a key and a value.
protected
_dumpNode(string $key, string $value, int $indent[, bool $sequence = false ]) : string
Parameters
- $key : string
-
The name of the key.
- $value : string
-
The value of the item.
- $indent : int
-
The indent of the current node.
- $sequence : bool = false
-
Is this an entry of a sequence?
Return values
string —_fold()
Folds a string of text, if necessary.
protected
_fold( $value, mixed $indent) : string
Parameters
Return values
string —_yamlize()
Attempts to convert a key/value array item to YAML.
protected
_yamlize(string $key, string|array<string|int, mixed> $value, int $indent[, bool $sequence = false ]) : string
Parameters
- $key : string
-
The name of the key.
- $value : string|array<string|int, mixed>
-
The value of the item.
- $indent : int
-
The indent of the current node.
- $sequence : bool = false
-
Is this an entry of a sequence?
Return values
string —_yamlizeArray()
Attempts to convert an array to YAML
protected
_yamlizeArray(array<string|int, mixed> $array, int $indent) : string
Parameters
- $array : array<string|int, mixed>
-
The array you want to convert.
- $indent : int
-
The indent of the current level.