category Zend
package Zend_Config
copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

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

__clone() : void
Inherited

inherited_from \Zend_Config::__clone()

Loads the section $section from the config file $filename for access facilitated by nested object properties.

__construct(string $filename, string | null $section, boolean | array $options) : void

If the section name contains a ":" then the section name to the right is loaded and included into the properties. Note that the keys in this $section will override any keys of the same name in the sections that have been included via ":". If the $section is null, then all sections in the ini file are loaded. If any key includes a ".", then this will act as a separator to create a sub-property. example ini file: [all] db.connection = database hostname = live [staging : all] hostname = staging after calling $data = new Zend_Config_Ini($file, 'staging'); then $data->hostname === "staging" $data->db->connection === "database" 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, 'nestSeparator' => '->' );

Parameters

$filename

string

$section

stringnull

$options

booleanarray

Exceptions

\Zend_Config_Exception

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

__get(string $name) : mixed
Inherited

inherited_from \Zend_Config::__get()

Parameters

$name

string

Returns

mixed

Support isset() overloading on PHP 5.1

__isset(string $name) : boolean
Inherited

inherited_from \Zend_Config::__isset()

Parameters

$name

string

Returns

boolean

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

__set(string $name, mixed $value) : void
Inherited

inherited_from \Zend_Config::__set()

Parameters

$name

string

$value

mixed

Exceptions

\Zend_Config_Exception

Support unset() overloading on PHP 5.1

__unset(string $name) : void
Inherited

inherited_from \Zend_Config::__unset()

Parameters

$name

string

Exceptions

\Zend_Config_Exception

Returns true if all sections were loaded

areAllSectionsLoaded() : boolean
Inherited

inherited_from \Zend_Config::areAllSectionsLoaded()

Returns

boolean

Defined by Countable interface

count() : int
Inherited

inherited_from \Zend_Config::count()

Returns

int

Defined by Iterator interface

current() : mixed
Inherited

inherited_from \Zend_Config::current()

Returns

mixed

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

get(string $name, mixed $default) : mixed
Inherited

inherited_from \Zend_Config::get()

Parameters

$name

string

$default

mixed

Returns

mixed

Get the current extends

getExtends() : array
Inherited

inherited_from \Zend_Config::getExtends()

Returns

array

Returns the section name(s) loaded.

getSectionName() : mixed
Inherited

inherited_from \Zend_Config::getSectionName()

Returns

mixed

Defined by Iterator interface

key() : mixed
Inherited

inherited_from \Zend_Config::key()

Returns

mixed

Merge another Zend_Config with this one. The items in $merge will override the same named items in the current config.

merge(Zend_Config $merge) : \Zend_Config
Inherited

inherited_from \Zend_Config::merge()

Parameters

$merge

\Zend_Config

Returns

Returns if this Zend_Config object is read only or not.

readOnly() : boolean
Inherited

inherited_from \Zend_Config::readOnly()

Returns

boolean

Defined by Iterator interface

rewind() 
Inherited

inherited_from \Zend_Config::rewind()

Set an extend for Zend_Config_Writer

setExtend(string $extendingSection, string $extendedSection) : void
Inherited

inherited_from \Zend_Config::setExtend()

Parameters

$extendingSection

string

$extendedSection

string

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.

setReadOnly() 
Inherited

inherited_from \Zend_Config::setReadOnly()

Return an associative array of the stored data.

toArray() : array
Inherited

inherited_from \Zend_Config::toArray()

Returns

array

Defined by Iterator interface

valid() : boolean
Inherited

inherited_from \Zend_Config::valid()

Returns

boolean

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

_assertValidExtend(string $extendingSection, string $extendedSection) : void
Inherited

inherited_from \Zend_Config::_assertValidExtend()

Parameters

$extendingSection

string

$extendedSection

string

Exceptions

\Zend_Config_Exception

Handle any errors from simplexml_load_file or parse_ini_file

_loadFileErrorHandler(integer $errno, string $errstr, string $errfile, integer $errline) 
Inherited

inherited_from \Zend_Config::_loadFileErrorHandler()

Parameters

$errno

integer

$errstr

string

$errfile

string

$errline

integer

Load the ini file and preprocess the section separator (':' in the section name (that is used for section extension) so that the resultant array has the correct section names and the extension information is stored in a sub-key called ';extends'. We use ';extends' as this can never be a valid key name in an INI file that has been loaded using parse_ini_file().

_loadIniFile(string $filename) : array

Parameters

$filename

string

Exceptions

\Zend_Config_Exception

Returns

array

Assign the key's value to the property list. Handles the nest separator for sub-properties.

_processKey(array $config, string $key, string $value) : array

Parameters

$config

array

$key

string

$value

string

Exceptions

\Zend_Config_Exception

Returns

array

Process each element in the section and handle the ";extends" inheritance key. Passes control to _processKey() to handle the nest separator sub-property syntax that may be used within the key name.

_processSection(array $iniArray, string $section, array $config) : array

Parameters

$iniArray

array

$section

string

$config

array

Exceptions

\Zend_Config_Exception

Returns

array

 Properties

 

Whether in-memory modifications to configuration data are allowed

$_allowModifications : boolean
Inherited

inherited_from \Zend_Config::$$_allowModifications
 

Number of elements in configuration data

$_count : integer
Inherited

inherited_from \Zend_Config::$$_count
 

Contains array of configuration data

$_data : array
Inherited

inherited_from \Zend_Config::$$_data
 

This is used to track section inheritance. The keys are names of sections that extend other sections, and the values are the extended sections.

$_extends : array
Inherited

inherited_from \Zend_Config::$$_extends
 

Iteration index

$_index : integer
Inherited

inherited_from \Zend_Config::$$_index
 

Load file error string.

$_loadFileErrorStr : string
Inherited

Is null if there was no error while file loading

inherited_from \Zend_Config::$$_loadFileErrorStr
 

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.

$_loadedSection : mixed
Inherited

inherited_from \Zend_Config::$$_loadedSection
 

String that separates nesting levels of configuration data identifiers

$_nestSeparator : string

 

String that separates the parent section name

$_sectionSeparator : string

 

Wether to skip extends or not

$_skipExtends : boolean

 

Used when unsetting values during iteration to ensure we do not skip the next element

$_skipNextIteration : boolean
Inherited

inherited_from \Zend_Config::$$_skipNextIteration