Config.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

Package: Zend_Config
Implements
Children
\Zend_Config_Yaml
\Zend_Config_Json
\Zend_Config_Xml
\Zend_Config_Ini
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotectedboolean $_allowModifications
Whether in-memory modifications to configuration data are allowed
Details
Type
boolean
>VPropertyprotectedinteger $_count
Number of elements in configuration data
Details
Type
integer
>VPropertyprotectedarray $_data
Contains array of configuration data
Details
Type
array
>VPropertyprotectedarray $_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.
Default valuearray()Details
Type
array
>VPropertyprotectedinteger $_index
Iteration index
Details
Type
integer
>VPropertyprotectedstring $_loadFileErrorStr = null
Load file error string.
Is null if there was no error while file loading
Default valuenullDetails
Type
string
>VPropertyprotectedmixed $_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.
Details
Type
mixed
>VPropertyprotectedboolean $_skipNextIteration
Used when unsetting values during iteration to ensure we do not skip the next element
Details
Type
boolean

Methods

methodpublic__clone() : void

Deep clone of this instance to ensure that nested Zend_Configs are also cloned.

methodpublic__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.
Parameters
NameTypeDescription
$arrayarray
$allowModificationsboolean
methodpublic__get(string $name) : mixed

Magic function so that $obj->value will work.

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
mixed
methodpublic__isset(string $name) : boolean

Support isset() overloading on PHP 5.1

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
boolean
methodpublic__set(string $name, mixed $value) : void

Only allow setting of a property if $allowModifications was set to true on construction. Otherwise, throw an exception.

Parameters
NameTypeDescription
$namestring
$valuemixed
Throws
ExceptionDescription
\Zend_Config_Exception
methodpublic__unset(string $name) : void

Support unset() overloading on PHP 5.1

Parameters
NameTypeDescription
$namestring
Throws
ExceptionDescription
\Zend_Config_Exception
methodprotected_arrayMergeRecursive(mixed $firstArray, mixed $secondArray) : array

Merge two arrays recursively, overwriting keys of the same name in $firstArray with the value in $secondArray.

Parameters
NameTypeDescription
$firstArraymixed

First array

$secondArraymixed

Second array to merge into first array

Returns
TypeDescription
array
methodprotected_assertValidExtend(string $extendingSection, string $extendedSection) : void

Throws an exception if $extendingSection may not extend $extendedSection, and tracks the section extension if it is valid.

Parameters
NameTypeDescription
$extendingSectionstring
$extendedSectionstring
Throws
ExceptionDescription
\Zend_Config_Exception
methodpublic_loadFileErrorHandler(integer $errno, string $errstr, string $errfile, integer $errline) : void

Handle any errors from simplexml_load_file or parse_ini_file

Parameters
NameTypeDescription
$errnointeger
$errstrstring
$errfilestring
$errlineinteger
methodpublicareAllSectionsLoaded() : boolean

Returns true if all sections were loaded

Returns
TypeDescription
boolean
methodpubliccount() : int

Defined by Countable interface

Returns
TypeDescription
int
methodpubliccurrent() : mixed

Defined by Iterator interface

Returns
TypeDescription
mixed
methodpublicget(string $name, mixed $default = null) : mixed

Retrieve a value and return $default if there is no element set.

Parameters
NameTypeDescription
$namestring
$defaultmixed
Returns
TypeDescription
mixed
methodpublicgetExtends() : array

Get the current extends

Returns
TypeDescription
array
methodpublicgetSectionName() : mixed

Returns the section name(s) loaded.

Returns
TypeDescription
mixed
methodpublickey() : mixed

Defined by Iterator interface

Returns
TypeDescription
mixed
methodpublicmerge(\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.

Parameters
NameTypeDescription
$merge\Zend_Config
Returns
TypeDescription
\Zend_Config
methodpublicnext() : void

Defined by Iterator interface

methodpublicreadOnly() : boolean

Returns if this Zend_Config object is read only or not.

Returns
TypeDescription
boolean
methodpublicrewind() : void

Defined by Iterator interface

methodpublicsetExtend(string $extendingSection, string $extendedSection = null) : void

Set an extend for Zend_Config_Writer

Parameters
NameTypeDescription
$extendingSectionstring
$extendedSectionstring
methodpublicsetReadOnly() : 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.

methodpublictoArray() : array

Return an associative array of the stored data.

Returns
TypeDescription
array
methodpublicvalid() : boolean

Defined by Iterator interface

Returns
TypeDescription
boolean
Documentation was generated by phpDocumentor 2.2.0 .