Config/Xml.php

Show: PublicProtectedPrivateinherited
Table of Contents
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.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Config  
Version
$Id$  

\Zend_Config_Xml

Package: Zend_Config
XML Adapter for Zend_Config
Parent(s)
\Zend_Config
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

>VConstant  XML_NAMESPACE = 'http://framework.zend.com/xml/zend-config-xml/1.0/'
XML namespace for ZF-related tags and attributes

Properties

>VPropertyprotectedboolean $_skipExtends = false
Whether to skip extends or not
Default valuefalseDetails
Type
boolean

Methods

methodpublic__construct(string $xml, mixed $section = null, array | boolean $options = false) : void

Loads the section $section from the config file (or string $xml for access facilitated by nested object properties.

Sections are defined in the XML as children of the root element. In order to extend another section, a section defines the "extends" attribute 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". The $options parameter may be provided as either a boolean or an array. If provided as a boolean, this sets the $allowModifications option of Zend_Config. If provided as an array, there are two configuration directives that may be set. For example: $options = array( 'allowModifications' => false, 'skipExtends' => false );
Parameters
NameTypeDescription
$xmlstring

XML file or string to process

$sectionmixed

Section to process

$optionsarray | boolean
Throws
ExceptionDescription
\Zend_Config_ExceptionWhen xml is not set or cannot be loaded
\Zend_Config_ExceptionWhen section $sectionName cannot be found in $xml
methodprotected_processExtends(\SimpleXMLElement $element, string $section, array $config = array()) : array

Helper function to process each element in the section and handle the "extends" inheritance attribute.

Parameters
NameTypeDescription
$element\SimpleXMLElement

XML Element to process

$sectionstring

Section to process

$configarray

Configuration which was parsed yet

Returns
TypeDescription
array
Throws
ExceptionDescription
\Zend_Config_ExceptionWhen $section cannot be found
methodprotected_toArray(\SimpleXMLElement $xmlObject) : array | string

Returns a string or an associative and possibly multidimensional array from a SimpleXMLElement.

Parameters
NameTypeDescription
$xmlObject\SimpleXMLElement

Convert a SimpleXMLElement into an array

Returns
TypeDescription
array | string
Documentation was generated by phpDocumentor 2.2.0 .