Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
YAML Adapter for Zend_Config

bool
$_ignoreConstants= 'false'
Whether or not to ignore constants in parsed YAML
false
Details
boolean
$_skipExtends= 'false'
Whether to skip extends or not
false
Details
__construct(
string $yaml, mixed $section
=
null, array|boolean $options
=
false
)
:
void
Loads the section $section from the config file encoded as YAML
Sections are defined as properties of the main object
In order to extend another section, a section defines the "_extends" property having a value of the section name from which the extending section inherits values.
Note that the keys in $section will override any keys of the same name in the sections that have been included via "_extends".
Options may include: - allow_modifications: whether or not the config object is mutable - skip_extends: whether or not to skip processing of parent configuration - yaml_decoder: a callback to use to decode the Yaml source
Name | Type | Description |
---|---|---|
$yaml | string | YAML file to process |
$section | mixed | Section to process |
$options | array|boolean |

_decodeYaml(
int $currentIndent, array $lines
)
:
array|string
Service function to decode YAML
Name | Type | Description |
---|---|---|
$currentIndent | int | Current indent level |
$lines | array | YAML lines |
Type | Description |
---|---|
array|string |

_getConstants(
)
:
array
Get (reverse) sorted list of defined constant names
Type | Description |
---|---|
array |

_processExtends(
array $data, string $section, array $config
=
array()
)
:
array
Helper function to process each element in the section and handle the "_extends" inheritance attribute.
Name | Type | Description |
---|---|---|
$data | array | Data array to process |
$section | string | Section to process |
$config | array | Configuration which was parsed yet |
Type | Description |
---|---|
array |
Exception | Description |
---|---|
\Zend_Config_Exception | When $section cannot be found |

_replaceConstants(
string $value
)
:
string
Replace any constants referenced in a string with their values
Name | Type | Description |
---|---|---|
$value | string |
Type | Description |
---|---|
string |

decode(
string $yaml
)
:
array
Very dumb YAML parser
Until we have Zend_Yaml...
Name | Type | Description |
---|---|---|
$yaml | string | YAML source |
Type | Description |
---|---|
array | Decoded data |

ignoreConstants(
)
:
bool
Whether parser should ignore constants or not
Type | Description |
---|---|
bool |

setIgnoreConstants(
bool $flag
)
:
void
Indicate whether parser should ignore constants or not
Name | Type | Description |
---|---|---|
$flag | bool |

setYamlDecoder(
\callable $yamlDecoder
)
:
\Zend_Config_Yaml
Set callback for decoding YAML
Name | Type | Description |
---|---|---|
$yamlDecoder | \callable | the decoder to set |
Type | Description |
---|---|
\Zend_Config_Yaml |