PHP Класс Zend_Config

Наследование: implements Countable, implements Iterator
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_allowModifications boolean Whether in-memory modifications to configuration data are allowed
$_count integer Number of elements in configuration data
$_data array Contains array of configuration data
$_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.
$_index integer Iteration index
$_loadFileErrorStr string Is null if there was no error while file loading
$_loadedSection mixed 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.
$_skipNextIteration boolean Used when unsetting values during iteration to ensure we do not skip the next element

Открытые методы

Метод Описание
__clone ( ) : void Deep clone of this instance to ensure that nested Zend_Configs are also cloned.
__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.
__get ( string $name ) : mixed Magic function so that $obj->value will work.
__isset ( string $name ) : boolean Support isset() overloading on PHP 5.1
__set ( string $name, mixed $value ) : void Only allow setting of a property if $allowModifications was set to true on construction. Otherwise, throw an exception.
__unset ( string $name ) : void Support unset() overloading on PHP 5.1
areAllSectionsLoaded ( ) : boolean Returns true if all sections were loaded
count ( ) : integer Defined by Countable interface
current ( ) : mixed Defined by Iterator interface
get ( string $name, mixed $default = null ) : mixed Retrieve a value and return $default if there is no element set.
getExtends ( ) : array Get the current extends
getSectionName ( ) : mixed Returns the section name(s) loaded.
key ( ) : mixed Defined by Iterator interface
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.
next ( ) Defined by Iterator interface
readOnly ( ) : boolean Returns if this Zend_Config object is read only or not.
rewind ( ) Defined by Iterator interface
setExtend ( string $extendingSection, string $extendedSection = null ) : void Set an extend for Zend_Config_Writer
setReadOnly ( ) 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.
toArray ( ) : array Return an associative array of the stored data.
valid ( ) : boolean Defined by Iterator interface

Защищенные методы

Метод Описание
_arrayMergeRecursive ( mixed $firstArray, mixed $secondArray ) : array Merge two arrays recursively, overwriting keys of the same name in $firstArray with the value in $secondArray.
_assertValidExtend ( string $extendingSection, string $extendedSection ) : void Throws an exception if $extendingSection may not extend $extendedSection, and tracks the section extension if it is valid.
_loadFileErrorHandler ( integer $errno, string $errstr, string $errfile, integer $errline ) Handle any errors from simplexml_load_file or parse_ini_file

Описание методов

__clone() публичный Метод

Deep clone of this instance to ensure that nested Zend_Configs are also cloned.
public __clone ( ) : void
Результат void

__construct() публичный Метод

Zend_Config also implements Countable and Iterator to facilitate easy access to the data.
public __construct ( array $array, boolean $allowModifications = false ) : void
$array array
$allowModifications boolean
Результат void

__get() публичный Метод

Magic function so that $obj->value will work.
public __get ( string $name ) : mixed
$name string
Результат mixed

__isset() публичный Метод

Support isset() overloading on PHP 5.1
public __isset ( string $name ) : boolean
$name string
Результат boolean

__set() публичный Метод

Only allow setting of a property if $allowModifications was set to true on construction. Otherwise, throw an exception.
public __set ( string $name, mixed $value ) : void
$name string
$value mixed
Результат void

__unset() публичный Метод

Support unset() overloading on PHP 5.1
public __unset ( string $name ) : void
$name string
Результат void

_arrayMergeRecursive() защищенный Метод

Merge two arrays recursively, overwriting keys of the same name in $firstArray with the value in $secondArray.
protected _arrayMergeRecursive ( mixed $firstArray, mixed $secondArray ) : array
$firstArray mixed First array
$secondArray mixed Second array to merge into first array
Результат array

_assertValidExtend() защищенный Метод

Throws an exception if $extendingSection may not extend $extendedSection, and tracks the section extension if it is valid.
protected _assertValidExtend ( string $extendingSection, string $extendedSection ) : void
$extendingSection string
$extendedSection string
Результат void

_loadFileErrorHandler() защищенный Метод

Handle any errors from simplexml_load_file or parse_ini_file
protected _loadFileErrorHandler ( integer $errno, string $errstr, string $errfile, integer $errline )
$errno integer
$errstr string
$errfile string
$errline integer

areAllSectionsLoaded() публичный Метод

Returns true if all sections were loaded
public areAllSectionsLoaded ( ) : boolean
Результат boolean

count() публичный Метод

Defined by Countable interface
public count ( ) : integer
Результат integer

current() публичный Метод

Defined by Iterator interface
public current ( ) : mixed
Результат mixed

get() публичный Метод

Retrieve a value and return $default if there is no element set.
public get ( string $name, mixed $default = null ) : mixed
$name string
$default mixed
Результат mixed

getExtends() публичный Метод

Get the current extends
public getExtends ( ) : array
Результат array

getSectionName() публичный Метод

Returns the section name(s) loaded.
public getSectionName ( ) : mixed
Результат mixed

key() публичный Метод

Defined by Iterator interface
public key ( ) : mixed
Результат mixed

merge() публичный Метод

Merge another Zend_Config with this one. The items in $merge will override the same named items in the current config.
public merge ( Zend_Config $merge ) : Zend_Config
$merge Zend_Config
Результат Zend_Config

next() публичный Метод

Defined by Iterator interface
public next ( )

readOnly() публичный Метод

Returns if this Zend_Config object is read only or not.
public readOnly ( ) : boolean
Результат boolean

rewind() публичный Метод

Defined by Iterator interface
public rewind ( )

setExtend() публичный Метод

Set an extend for Zend_Config_Writer
public setExtend ( string $extendingSection, string $extendedSection = null ) : void
$extendingSection string
$extendedSection string
Результат void

setReadOnly() публичный Метод

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

toArray() публичный Метод

Return an associative array of the stored data.
public toArray ( ) : array
Результат array

valid() публичный Метод

Defined by Iterator interface
public valid ( ) : boolean
Результат boolean

Описание свойств

$_allowModifications защищенное свойство

Whether in-memory modifications to configuration data are allowed
protected bool $_allowModifications
Результат boolean

$_count защищенное свойство

Number of elements in configuration data
protected int $_count
Результат integer

$_data защищенное свойство

Contains array of configuration data
protected array $_data
Результат array

$_extends защищенное свойство

This is used to track section inheritance. The keys are names of sections that extend other sections, and the values are the extended sections.
protected array $_extends
Результат array

$_index защищенное свойство

Iteration index
protected int $_index
Результат integer

$_loadFileErrorStr защищенное свойство

Is null if there was no error while file loading
protected string $_loadFileErrorStr
Результат string

$_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.
protected mixed $_loadedSection
Результат mixed

$_skipNextIteration защищенное свойство

Used when unsetting values during iteration to ensure we do not skip the next element
protected bool $_skipNextIteration
Результат boolean