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.
XML Adapter for Zend_Config

__clone(
)
:
void
Deep clone of this instance to ensure that nested Zend_Configs are also cloned.
Inherited from: \Zend_Config::__clone()
__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 );
Name | Type | Description |
---|---|---|
$xml | string | XML file or string to process |
$section | mixed | Section to process |
$options | array|boolean |
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 |

__get(
string $name
)
:
mixed
Magic function so that $obj->value will work.
Inherited from: \Zend_Config::__get()Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
mixed |

__isset(
string $name
)
:
boolean
Support isset() overloading on PHP 5.1
Inherited from: \Zend_Config::__isset()Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
boolean |

__set(
string $name, mixed $value
)
:
void
Only allow setting of a property if $allowModifications was set to true on construction. Otherwise, throw an exception.
Inherited from: \Zend_Config::__set()Name | Type | Description |
---|---|---|
$name | string | |
$value | mixed |
Exception | Description |
---|---|
\Zend_Config_Exception |

__unset(
string $name
)
:
void
Support unset() overloading on PHP 5.1
Inherited from: \Zend_Config::__unset()
_arrayMergeRecursive(
mixed $firstArray, mixed $secondArray
)
:
array
Merge two arrays recursively, overwriting keys of the same name in $firstArray with the value in $secondArray.
Inherited from: \Zend_Config::_arrayMergeRecursive()Name | Type | Description |
---|---|---|
$firstArray | mixed | First array |
$secondArray | mixed | Second array to merge into first array |
Type | Description |
---|---|
array |

_assertValidExtend(
string $extendingSection, string $extendedSection
)
:
void
Throws an exception if $extendingSection may not extend $extendedSection, and tracks the section extension if it is valid.
Inherited from: \Zend_Config::_assertValidExtend()Name | Type | Description |
---|---|---|
$extendingSection | string | |
$extendedSection | string |
Exception | Description |
---|---|
\Zend_Config_Exception |

_loadFileErrorHandler(
integer $errno, string $errstr, string $errfile, integer $errline
)
:
void
Handle any errors from simplexml_load_file or parse_ini_file
Inherited from: \Zend_Config::_loadFileErrorHandler()Name | Type | Description |
---|---|---|
$errno | integer | |
$errstr | string | |
$errfile | string | |
$errline | integer |

_processExtends(
\SimpleXMLElement $element, string $section, array $config
=
array
)
:
array
Helper function to process each element in the section and handle the "extends" inheritance attribute.
Name | Type | Description |
---|---|---|
$element | \SimpleXMLElement | XML Element to process |
$section | string | Section to process |
$config | array | Configuration which was parsed yet |
Type | Description |
---|---|
array |
Exception | Description |
---|---|
\Zend_Config_Exception | When $section cannot be found |

_toArray(
\SimpleXMLElement $xmlObject
)
:
array|string
Returns a string or an associative and possibly multidimensional array from a SimpleXMLElement.
Name | Type | Description |
---|---|---|
$xmlObject | \SimpleXMLElement | Convert a SimpleXMLElement into an array |
Type | Description |
---|---|
arraystring |

areAllSectionsLoaded(
)
:
boolean
Returns true if all sections were loaded
Inherited from: \Zend_Config::areAllSectionsLoaded()Type | Description |
---|---|
boolean |

count(
)
:
int
Defined by Countable interface
Inherited from: \Zend_Config::count()Type | Description |
---|---|
int |

current(
)
:
mixed
Defined by Iterator interface
Inherited from: \Zend_Config::current()Type | Description |
---|---|
mixed |

get(
string $name, mixed $default
=
null
)
:
mixed
Retrieve a value and return $default if there is no element set.
Inherited from: \Zend_Config::get()Name | Type | Description |
---|---|---|
$name | string | |
$default | mixed |
Type | Description |
---|---|
mixed |

getExtends(
)
:
array
Get the current extends
Inherited from: \Zend_Config::getExtends()Type | Description |
---|---|
array |

getSectionName(
)
:
mixed
Returns the section name(s) loaded.
Inherited from: \Zend_Config::getSectionName()Type | Description |
---|---|
mixed |

key(
)
:
mixed
Defined by Iterator interface
Inherited from: \Zend_Config::key()Type | Description |
---|---|
mixed |

merge(
\Zend_Config $merge
)
:
\Zend_Config
Merge another Zend_Config with this one. The items in $merge will override the same named items in the current config.
Inherited from: \Zend_Config::merge()Name | Type | Description |
---|---|---|
$merge | \Zend_Config |
Type | Description |
---|---|
\Zend_Config |

readOnly(
)
:
boolean
Returns if this Zend_Config object is read only or not.
Inherited from: \Zend_Config::readOnly()Type | Description |
---|---|
boolean |

setExtend(
string $extendingSection, string $extendedSection
=
null
)
:
void
Set an extend for Zend_Config_Writer
Inherited from: \Zend_Config::setExtend()Name | Type | Description |
---|---|---|
$extendingSection | string | |
$extendedSection | string |

setReadOnly(
)
:
void
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.
Inherited from: \Zend_Config::setReadOnly()
toArray(
)
:
array
Return an associative array of the stored data.
Inherited from: \Zend_Config::toArray()Type | Description |
---|---|
array |

valid(
)
:
boolean
Defined by Iterator interface
Inherited from: \Zend_Config::valid()Type | Description |
---|---|
boolean |