Configuration class for phpDocumentor.

This class is responsible for registering and remembering the configuration settings. During initialization several configuration parameters are added and the configurations for the templates are merged.

category phpDocumentor
package Core
author Mike van Riel
license MIT
link http://phpdoc.org
copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)

 Methods

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

__clone() : void
Inherited

inherited_from \Zend_Config::__clone()
inherited_from \Zend_Config_Xml::__clone()

Initializes the configuration.

__construct(string $xml, string | null $section) : void

Sections are defined in the XML as children of the root element. In order to extend another section, a section defines the "extends" attribute having a value of the section name from which the extending section inherits values. Note that the keys in $section will override any keys of the same name in the sections that have been included via "extends".

Parameters

$xml

string

File or XML text representing the configuration.

$section

stringnull

Which section of the configuration to load.

Exceptions

\Zend_Config_Exception When xml is not set or cannot be loaded
\Zend_Config_Exception When section $sectionName cannot be found in $xml

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

__get(string $name) : mixed
Inherited

inherited_from \Zend_Config::__get()
inherited_from \Zend_Config_Xml::__get()

Parameters

$name

string

Returns

mixed

Support isset() overloading on PHP 5.1

__isset(string $name) : boolean
Inherited

inherited_from \Zend_Config::__isset()
inherited_from \Zend_Config_Xml::__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()
inherited_from \Zend_Config_Xml::__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()
inherited_from \Zend_Config_Xml::__unset()

Parameters

$name

string

Exceptions

\Zend_Config_Exception

Returns true if all sections were loaded

areAllSectionsLoaded() : boolean
Inherited

inherited_from \Zend_Config::areAllSectionsLoaded()
inherited_from \Zend_Config_Xml::areAllSectionsLoaded()

Returns

boolean

Defined by Countable interface

count() : int
Inherited

inherited_from \Zend_Config::count()
inherited_from \Zend_Config_Xml::count()

Returns

int

Defined by Iterator interface

current() : mixed
Inherited

inherited_from \Zend_Config::current()
inherited_from \Zend_Config_Xml::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()
inherited_from \Zend_Config_Xml::get()

Parameters

$name

string

$default

mixed

Returns

mixed

Returns the items of the given path as an array.

getArrayFromPath(string $path) : \string[]

A path may be shown as item/item and will always be taken from this object and thus be relative to this object.

Parameters

$path

string

the path from which to retrieve the settings.

Returns

\string[]

Get the current extends

getExtends() : array
Inherited

inherited_from \Zend_Config::getExtends()
inherited_from \Zend_Config_Xml::getExtends()

Returns

array

Returns the section name(s) loaded.

getSectionName() : mixed
Inherited

inherited_from \Zend_Config::getSectionName()
inherited_from \Zend_Config_Xml::getSectionName()

Returns

mixed

Defined by Iterator interface

key() : mixed
Inherited

inherited_from \Zend_Config::key()
inherited_from \Zend_Config_Xml::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()
inherited_from \Zend_Config_Xml::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()
inherited_from \Zend_Config_Xml::readOnly()

Returns

boolean

Defined by Iterator interface

rewind() 
Inherited

inherited_from \Zend_Config::rewind()
inherited_from \Zend_Config_Xml::rewind()

Set an extend for Zend_Config_Writer

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

inherited_from \Zend_Config::setExtend()
inherited_from \Zend_Config_Xml::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()
inherited_from \Zend_Config_Xml::setReadOnly()

Return an associative array of the stored data.

toArray() : array
Inherited

inherited_from \Zend_Config::toArray()
inherited_from \Zend_Config_Xml::toArray()

Returns

array

Defined by Iterator interface

valid() : boolean
Inherited

inherited_from \Zend_Config::valid()
inherited_from \Zend_Config_Xml::valid()

Returns

boolean

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

_arrayMergeRecursive(mixed $firstArray, mixed $secondArray) : array
Inherited

inherited_from \Zend_Config_Xml::_arrayMergeRecursive()

Parameters

$firstArray

mixed

First array

$secondArray

mixed

Second array to merge into first array

Returns

array

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()
inherited_from \Zend_Config_Xml::_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()
inherited_from \Zend_Config_Xml::_loadFileErrorHandler()

Parameters

$errno

integer

$errstr

string

$errfile

string

$errline

integer

Helper function to process each element in the section and handle the "extends" inheritance attribute.

_processExtends(SimpleXMLElement $element, string $section, array $config) : array
Inherited

inherited_from \Zend_Config_Xml::_processExtends()

Parameters

$element

\SimpleXMLElement

XML Element to process

$section

string

Section to process

$config

array

Configuration which was parsed yet

Exceptions

\Zend_Config_Exception When $section cannot be found

Returns

array

Returns a string or an associative and possibly multidimensional array from a SimpleXMLElement.

_toArray(SimpleXMLElement $xmlObject) : array | string
Inherited

inherited_from \Zend_Config_Xml::_toArray()

Parameters

$xmlObject

\SimpleXMLElement

Convert a SimpleXMLElement into an array

Returns

arraystring

Merges the configurations of the templates into this configuration.

mergeTemplateConfigurations() : void

 Properties

 

Whether in-memory modifications to configuration data are allowed

$_allowModifications : boolean
Inherited

inherited_from \Zend_Config::$$_allowModifications
inherited_from \Zend_Config_Xml::$$_allowModifications
 

Number of elements in configuration data

$_count : integer
Inherited

inherited_from \Zend_Config::$$_count
inherited_from \Zend_Config_Xml::$$_count
 

Contains array of configuration data

$_data : array
Inherited

inherited_from \Zend_Config::$$_data
inherited_from \Zend_Config_Xml::$$_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
inherited_from \Zend_Config_Xml::$$_extends
 

Iteration index

$_index : integer
Inherited

inherited_from \Zend_Config::$$_index
inherited_from \Zend_Config_Xml::$$_index
 

Load file error string.

$_loadFileErrorStr : string
Inherited

Is null if there was no error while file loading

inherited_from \Zend_Config::$$_loadFileErrorStr
inherited_from \Zend_Config_Xml::$$_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
inherited_from \Zend_Config_Xml::$$_loadedSection
 

Wether to skip extends or not

$_skipExtends : boolean
Inherited

inherited_from \Zend_Config_Xml::$$_skipExtends
 

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

$_skipNextIteration : boolean
Inherited

inherited_from \Zend_Config::$$_skipNextIteration
inherited_from \Zend_Config_Xml::$$_skipNextIteration

 Constants

 

XML namespace for ZF-related tags and attributes

XML_NAMESPACE 
Inherited

inherited_from \Zend_Config_Xml::XML_NAMESPACE