Config.php
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: Config.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Config
- Implements
- Children
- \Zend_Config_Yaml
- \Zend_Config_Json
- \Zend_Config_Xml
- \Zend_Config_Ini
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties

boolean $_allowModifications- Type
- boolean

array $_extends = array()The keys are names of sections that extend other sections, and the values are the extended sections.
array()Details- Type
- array

string $_loadFileErrorStr = nullIs null if there was no error while file loading
nullDetails- Type
- string

mixed $_loadedSectionThis 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.
- Type
- mixed
Methods

__construct(array $array, boolean $allowModifications = false) : voidZend_Config provides a property based interface to an array.
The data are read-only unless $allowModifications is set to true on construction.
Zend_Config also implements Countable and Iterator to facilitate easy access to the data.
| Name | Type | Description |
|---|---|---|
| $array | array | |
| $allowModifications | boolean |

__get(string $name) : mixedMagic function so that $obj->value will work.
| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| mixed |

__isset(string $name) : booleanSupport isset() overloading on PHP 5.1
| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| boolean |

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

__unset(string $name) : voidSupport unset() overloading on PHP 5.1
| Name | Type | Description |
|---|---|---|
| $name | string |
| Exception | Description |
|---|---|
| \Zend_Config_Exception |

_arrayMergeRecursive(mixed $firstArray, mixed $secondArray) : arrayMerge two arrays recursively, overwriting keys of the same name in $firstArray with the value in $secondArray.
| Name | Type | Description |
|---|---|---|
| $firstArray | mixed | First array |
| $secondArray | mixed | Second array to merge into first array |
| Type | Description |
|---|---|
| array |

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

_loadFileErrorHandler(integer $errno, string $errstr, string $errfile, integer $errline) : voidHandle any errors from simplexml_load_file or parse_ini_file
| Name | Type | Description |
|---|---|---|
| $errno | integer | |
| $errstr | string | |
| $errfile | string | |
| $errline | integer |

areAllSectionsLoaded() : booleanReturns true if all sections were loaded
| Type | Description |
|---|---|
| boolean |

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

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

readOnly() : booleanReturns if this Zend_Config object is read only or not.
| Type | Description |
|---|---|
| boolean |

setExtend(string $extendingSection, string $extendedSection = null) : voidSet an extend for Zend_Config_Writer
| Name | Type | Description |
|---|---|---|
| $extendingSection | string | |
| $extendedSection | string |

setReadOnly() : voidPrevent 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.