\Zend_Config_Xml
XML 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_Xml
extends Zend_Config
{
- // constants
- const XML_NAMESPACE = 'http://framework.zend.com/xml/zend-config-xml/1.0/';
- // members
- protected $_skipExtends;
- // Inherited members from Zend_Config
- protected $_allowModifications;
- protected $_index;
- protected $_count;
- protected $_data;
- protected $_skipNextIteration;
- protected $_loadedSection;
- protected $_extends;
- protected $_loadFileErrorStr;
- // methods
- public void __construct()
- protected array _processExtends()
- protected array|string _toArray()
- // 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 |
---|---|---|
78 - 146 | CyclomaticComplexity | The method __construct() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10. |
78 - 146 | NPathComplexity | The method __construct() has an NPath complexity of 432. The configured NPath complexity threshold is 200. |
189 - 295 | CyclomaticComplexity | The method _toArray() has a Cyclomatic Complexity of 27. The configured cyclomatic complexity threshold is 10. |
189 - 295 | NPathComplexity | The method _toArray() has an NPath complexity of 9800. The configured NPath complexity threshold is 200. |
189 - 295 | ExcessiveMethodLength | The phpmd\node\methodnode _toArray() has 107 lines of code. Current threshold is set to 100. Avoid really long methods. |
Constants
Name | Value |
---|---|
XML_NAMESPACE | 'http://framework.zend.com/xml/zend-config-xml/1.0/' |
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. - $_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
Methods
protected
- _processExtends() — Helper function to process each element in the section and handle the "extends" inheritance attribute.
- _toArray() — Returns a string or an associative and possibly multidimensional array from a SimpleXMLElement.
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