API Documentation

Zend/Config/Xml.php

Show: inherited
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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Config  
Version
$Id: Xml.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_Config_Xml

Package: Zend\Config

XML Adapter for Zend_Config

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

Constants

Constant  XML_NAMESPACE = 'http://framework.zend.com/xml/zend-config-xml/1.0/'

XML namespace for ZF-related tags and attributes

Properties

Propertyprotectedboolean  $_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
Name Type Description
$xml string

XML file or string to process

$section mixed

Section to process

$options array|boolean
Throws
Exception Description
\Zend_Config_Exception When xml is not set or cannot be loaded
\Zend_Config_Exception When 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
Name Type Description
$element \SimpleXMLElement

XML Element to process

$section string

Section to process

$config array

Configuration which was parsed yet

Returns
Type Description
array
Throws
Exception Description
\Zend_Config_Exception When $section cannot be found
methodprotected_toArray( \SimpleXMLElement $xmlObject ) : array|string

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

Parameters
Name Type Description
$xmlObject \SimpleXMLElement

Convert a SimpleXMLElement into an array

Returns
Type Description
array|string
Documentation was generated by DocBlox 0.15.1.