PHP Class Zend_Config_Yaml

Inheritance: extends Zend_Config
Afficher le fichier Open project: dbpatch/dbpatch Class Usage Examples

Protected Properties

Свойство Type Description
$_ignoreConstants boolean Whether or not to ignore constants in parsed YAML
$_skipExtends boolean Whether to skip extends or not
$_yamlDecoder callable What to call when we need to decode some YAML?

Méthodes publiques

Méthode Description
__construct ( string $yaml, mixed $section = null, boolean $options = false ) Loads the section $section from the config file encoded as YAML
decode ( string $yaml ) : array Very dumb YAML parser
getYamlDecoder ( ) : callable Get callback for decoding YAML
ignoreConstants ( ) : boolean Whether parser should ignore constants or not
setIgnoreConstants ( boolean $flag ) : void Indicate whether parser should ignore constants or not
setYamlDecoder ( callable $yamlDecoder ) : Zend_Config_Yaml Set callback for decoding YAML

Méthodes protégées

Méthode Description
_decodeYaml ( integer $currentIndent, array &$lines ) : array | string Service function to decode YAML
_getConstants ( ) : array Get (reverse) sorted list of defined constant names
_processExtends ( array $data, string $section, array $config = [] ) : array Helper function to process each element in the section and handle the "_extends" inheritance attribute.
_replaceConstants ( string $value ) : string Replace any constants referenced in a string with their values

Method Details

__construct() public méthode

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
public __construct ( string $yaml, mixed $section = null, boolean $options = false )
$yaml string YAML file to process
$section mixed Section to process
$options boolean Whether modifiacations are allowed at runtime

_decodeYaml() protected static méthode

Service function to decode YAML
protected static _decodeYaml ( integer $currentIndent, array &$lines ) : array | string
$currentIndent integer Current indent level
$lines array YAML lines
Résultat array | string

_getConstants() protected static méthode

Get (reverse) sorted list of defined constant names
protected static _getConstants ( ) : array
Résultat array

_processExtends() protected méthode

Helper function to process each element in the section and handle the "_extends" inheritance attribute.
protected _processExtends ( array $data, string $section, array $config = [] ) : array
$data array Data array to process
$section string Section to process
$config array Configuration which was parsed yet
Résultat array

_replaceConstants() protected static méthode

Replace any constants referenced in a string with their values
protected static _replaceConstants ( string $value ) : string
$value string
Résultat string

decode() public static méthode

Until we have Zend_Yaml...
public static decode ( string $yaml ) : array
$yaml string YAML source
Résultat array Decoded data

getYamlDecoder() public méthode

Get callback for decoding YAML
public getYamlDecoder ( ) : callable
Résultat callable

ignoreConstants() public static méthode

Whether parser should ignore constants or not
public static ignoreConstants ( ) : boolean
Résultat boolean

setIgnoreConstants() public static méthode

Indicate whether parser should ignore constants or not
public static setIgnoreConstants ( boolean $flag ) : void
$flag boolean
Résultat void

setYamlDecoder() public méthode

Set callback for decoding YAML
public setYamlDecoder ( callable $yamlDecoder ) : Zend_Config_Yaml
$yamlDecoder callable the decoder to set
Résultat Zend_Config_Yaml

Property Details

$_ignoreConstants protected_oe static_oe property

Whether or not to ignore constants in parsed YAML
protected static bool $_ignoreConstants
Résultat boolean

$_skipExtends protected_oe property

Whether to skip extends or not
protected bool $_skipExtends
Résultat boolean

$_yamlDecoder protected_oe property

What to call when we need to decode some YAML?
protected callable $_yamlDecoder
Résultat callable