\Zend_Config_Yaml
YAML Adapter for Zend_Config
- Copyright: Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License: http://framework.zend.com/license/new-bsd New BSD License
Synopsis
class Zend_Config_Yaml
extends Zend_Config
{
- // constants
- const EXTENDS_NAME = "_extends";
- // members
- protected $_skipExtends;
- protected callable $_yamlDecoder;
- protected bool $_ignoreConstants;
- // Inherited members from Zend_Config
- protected $_allowModifications;
- protected $_index;
- protected $_count;
- protected $_data;
- protected $_skipNextIteration;
- protected $_loadedSection;
- protected $_extends;
- protected $_loadFileErrorStr;
- // methods
- public static void setIgnoreConstants()
- public static bool ignoreConstants()
- public callable getYamlDecoder()
- public Zend_Config_Yaml setYamlDecoder()
- public void __construct()
- protected array _processExtends()
- public static array decode()
- protected static array|string _decodeYaml()
- protected static string _parseValue()
- protected static string _replaceConstants()
- protected static array _getConstants()
- // Inherited methods from Zend_Config
- public void __construct()
- public mixed get()
- public mixed __get()
- public void __set()
- public void __clone()
- public array toArray()
- public boolean __isset()
- public void __unset()
- public int count()
- public mixed current()
- public mixed key()
- public void next()
- public void rewind()
- public boolean valid()
- public mixed getSectionName()
- public boolean areAllSectionsLoaded()
- public Zend_Config merge()
- public void setReadOnly()
- public boolean readOnly()
- public array getExtends()
- public void setExtend()
- protected void _assertValidExtend()
- protected void _loadFileErrorHandler()
- protected array _arrayMergeRecursive()
Hierarchy
Extends
Violations
PHPMessDetector
Line | Rule | Message |
---|---|---|
131 - 231 | CyclomaticComplexity | The method __construct() has a Cyclomatic Complexity of 22. The configured cyclomatic complexity threshold is 10. |
131 - 231 | NPathComplexity | The method __construct() has an NPath complexity of 864. The configured NPath complexity threshold is 200. |
131 - 231 | ExcessiveMethodLength | The phpmd\node\methodnode __construct() has 101 lines of code. Current threshold is set to 100. Avoid really long methods. |
288 - 352 | CyclomaticComplexity | The method _decodeYaml() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10. |
Constants
Name | Value |
---|---|
EXTENDS_NAME | "_extends" |
Members
protected
- $_allowModifications
—
boolean
Whether in-memory modifications to configuration data are allowed - $_count
—
integer
Number of elements in configuration data - $_data
—
array
Contains array of configuration data - $_extends
—
array
This is used to track section inheritance. The keys are names of sections that extend other sections, and the values are the extended sections. - $_ignoreConstants
—
bool
Whether or not to ignore constants in parsed YAML - $_index
—
integer
Iteration index - $_loadFileErrorStr
—
string
Load file error string. - $_loadedSection
—
mixed
Contains which config file sections were loaded. This is null if all sections were loaded, a string name if one section is loaded and an array of string names if multiple sections were loaded. - $_skipExtends
—
boolean
Whether to skip extends or not - $_skipNextIteration
—
boolean
Used when unsetting values during iteration to ensure we do not skip the next element - $_yamlDecoder
—
callable
What to call when we need to decode some YAML?
Methods
protected
- _decodeYaml() — Service function to decode YAML
- _getConstants() — Get (reverse) sorted list of defined constant names
- _parseValue() — Parse values
- _processExtends() — Helper function to process each element in the section and handle the "_extends" inheritance attribute.
- _replaceConstants() — Replace any constants referenced in a string with their values
public
- __construct() — Loads the section $section from the config file encoded as YAML
- decode() — Very dumb YAML parser
- getYamlDecoder() — Get callback for decoding YAML
- ignoreConstants() — Whether parser should ignore constants or not
- setIgnoreConstants() — Indicate whether parser should ignore constants or not
- setYamlDecoder() — Set callback for decoding YAML
Inherited from Zend_Config
protected
- _arrayMergeRecursive() — Merge two arrays recursively, overwriting keys of the same name in $firstArray with the value in $secondArray.
- _assertValidExtend() — Throws an exception if $extendingSection may not extend $extendedSection, and tracks the section extension if it is valid.
- _loadFileErrorHandler() — Handle any errors from simplexml_load_file or parse_ini_file
public
- __clone() — Deep clone of this instance to ensure that nested Zend_Configs are also cloned.
- __get() — Magic function so that $obj->value will work.
- __isset() — Support isset() overloading on PHP 5.1
- __set() — Only allow setting of a property if $allowModifications was set to true on construction. Otherwise, throw an exception.
- __unset() — Support unset() overloading on PHP 5.1
- areAllSectionsLoaded() — Returns true if all sections were loaded
- count() — Defined by Countable interface
- current() — Defined by Iterator interface
- get() — Retrieve a value and return $default if there is no element set.
- getExtends() — Get the current extends
- getSectionName() — Returns the section name(s) loaded.
- key() — Defined by Iterator interface
- merge() — Merge another Zend_Config with this one. The items in $merge will override the same named items in the current config.
- next() — Defined by Iterator interface
- readOnly() — Returns if this Zend_Config object is read only or not.
- rewind() — Defined by Iterator interface
- setExtend() — Set an extend for Zend_Config_Writer
- setReadOnly() — Prevent any more modifications being made to this instance. Useful after merge() has been used to merge multiple Zend_Config objects into one object which should then not be modified again.
- toArray() — Return an associative array of the stored data.
- valid() — Defined by Iterator interface
History
-
2014-09-29T11:07:23+02:00 (commit #15b41ee)
Author: Sylvain Rayé (sylvain.raye@rissip.com) / Commiter: Sylvain Rayé (sylvain.raye@rissip.com)
Add dependency library Zend_Config. Useful only for Unit Testing