Config.php
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 [email protected] 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 =
Whether in-memory modifications to configuration data are allowed
- Type
- boolean


array $_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.
array()
Details- Type
- array


string $_loadFileErrorStr = null
Load file error string.
Is null if there was no error while file loading
null
Details- Type
- string


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


__construct(array $array, boolean $allowModifications = false) : void
Zend_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) : mixed
Magic function so that $obj->value will work.
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
mixed |


__isset(string $name) : boolean
Support isset() overloading on PHP 5.1
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.
Name | Type | Description |
---|---|---|
$name | string | |
$value | mixed |
Exception | Description |
---|---|
\Zend_Config_Exception |


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


_arrayMergeRecursive(mixed $firstArray, mixed $secondArray) : array
Merge 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) : void
Throws 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) : void
Handle any errors from simplexml_load_file or parse_ini_file
Name | Type | Description |
---|---|---|
$errno | integer | |
$errstr | string | |
$errfile | string | |
$errline | integer |


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


get(string $name, mixed $default = null) : mixed
Retrieve 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_Config
Merge 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() : boolean
Returns if this Zend_Config object is read only or not.
Type | Description |
---|---|
boolean |


setExtend(string $extendingSection, string $extendedSection = null) : void
Set an extend for Zend_Config_Writer
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.