API Documentation

Zend/Config.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: Config.php 24594 2012-01-05 21:27:01Z matthew $  

\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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

Propertyprotectedboolean  $_allowModifications= ''

Whether in-memory modifications to configuration data are allowed

Details
Type
boolean
Propertyprotectedinteger  $_count= ''

Number of elements in configuration data

Details
Type
integer
Propertyprotectedarray  $_data= ''

Contains array of configuration data

Details
Type
array
Propertyprotectedarray  $_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
Propertyprotectedinteger  $_index= ''

Iteration index

Details
Type
integer
Propertyprotectedstring  $_loadFileErrorStr= 'null'

Load file error string.

Is null if there was no error while file loading

Default valuenullDetails
Type
string
Propertyprotectedmixed  $_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
Propertyprotectedboolean  $_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
Name Type Description
$array array
$allowModifications boolean
methodpublic__get( string $name ) : mixed

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

Parameters
Name Type Description
$name string
Returns
Type Description
mixed
methodpublic__isset( string $name ) : boolean

Support isset() overloading on PHP 5.1

Parameters
Name Type Description
$name string
Returns
Type Description
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
Name Type Description
$name string
$value mixed
Throws
Exception Description
\Zend_Config_Exception
methodpublic__unset( string $name ) : void

Support unset() overloading on PHP 5.1

Parameters
Name Type Description
$name string
Throws
Exception Description
\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
Name Type Description
$firstArray mixed

First array

$secondArray mixed

Second array to merge into first array

Returns
Type Description
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
Name Type Description
$extendingSection string
$extendedSection string
Throws
Exception Description
\Zend_Config_Exception
methodprotected_loadFileErrorHandler( integer $errno, string $errstr, string $errfile, integer $errline ) : void

Handle any errors from simplexml_load_file or parse_ini_file

Parameters
Name Type Description
$errno integer
$errstr string
$errfile string
$errline integer
methodpublicareAllSectionsLoaded( ) : boolean

Returns true if all sections were loaded

Returns
Type Description
boolean
methodpubliccount( ) : int

Defined by Countable interface

Returns
Type Description
int
methodpubliccurrent( ) : mixed

Defined by Iterator interface

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

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

Parameters
Name Type Description
$name string
$default mixed
Returns
Type Description
mixed
methodpublicgetExtends( ) : array

Get the current extends

Returns
Type Description
array
methodpublicgetSectionName( ) : mixed

Returns the section name(s) loaded.

Returns
Type Description
mixed
methodpublickey( ) : mixed

Defined by Iterator interface

Returns
Type Description
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
Name Type Description
$merge \Zend_Config
Returns
Type Description
\Zend_Config
methodpublicnext( ) : void

Defined by Iterator interface

methodpublicreadOnly( ) : boolean

Returns if this Zend_Config object is read only or not.

Returns
Type Description
boolean
methodpublicrewind( ) : void

Defined by Iterator interface

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

Set an extend for Zend_Config_Writer

Parameters
Name Type Description
$extendingSection string
$extendedSection string
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
Type Description
array
methodpublicvalid( ) : boolean

Defined by Iterator interface

Returns
Type Description
boolean
Documentation was generated by DocBlox 0.15.1.