Class Zend_Config

Description

Implements interfaces:

  • Countable (internal interface)
  • Iterator (internal interface)

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Config.php (line 29)


	
			
Direct descendents
Class Description
 class Zend_Config_Xml XML Adapter for Zend_Config
 class Zend_Config_Ini
Variable Summary
Method Summary
 void __construct ( $array, [boolean $allowModifications = false])
 int count ()
 mixed current ()
 mixed get (string $name, [mixed $default = null])
 array getExtends ()
 mixed getSectionName ()
 mixed key ()
 void next ()
 boolean readOnly ()
 void rewind ()
 void setExtend (string $extendingSection, [string $extendedSection = null])
 void setReadOnly ()
 array toArray ()
 boolean valid ()
 array _arrayMergeRecursive (mixed $firstArray, mixed $secondArray)
 void _assertValidExtend (string $extendingSection, string $extendedSection)
 void _loadFileErrorHandler (integer $errno, string $errstr, string $errfile, integer $errline)
 void __clone ()
 mixed __get (string $name)
 boolean __isset (string $name)
 void __set (string $name, mixed $value)
 void __unset (string $name)
Variables
boolean $_allowModifications (line 36)

Whether in-memory modifications to configuration data are allowed

  • access: protected
integer $_count (line 50)

Number of elements in configuration data

  • access: protected
array $_data (line 57)

Contains array of configuration data

  • access: protected
array $_extends = array() (line 82)

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

  • access: protected
integer $_index (line 43)

Iteration index

  • access: protected
mixed $_loadedSection (line 74)

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.

  • access: protected
string $_loadFileErrorStr = null (line 91)

Load file error string.

Is null if there was no error while file loading

  • access: protected
boolean $_skipNextIteration (line 65)

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

  • access: protected
Methods
Constructor __construct (line 105)

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.

  • access: public
void __construct ( $array, [boolean $allowModifications = false])
  • array $array
  • boolean $allowModifications

Redefined in descendants as:
areAllSectionsLoaded (line 327)

Returns true if all sections were loaded

  • access: public
boolean areAllSectionsLoaded ()
count (line 248)

Defined by Countable interface

  • access: public
int count ()

Implementation of:
Countable::count
current (line 258)

Defined by Iterator interface

  • access: public
mixed current ()

Implementation of:
Iterator::current
get (line 128)

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

  • access: public
mixed get (string $name, [mixed $default = null])
  • string $name
  • mixed $default
getExtends (line 393)

Get the current extends

  • access: public
array getExtends ()
getSectionName (line 314)

Returns the section name(s) loaded.

  • access: public
mixed getSectionName ()
key (line 269)

Defined by Iterator interface

  • access: public
mixed key ()

Implementation of:
Iterator::key
merge (line 341)

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

  • access: public
Zend_Config merge (Zend_Config $merge)
next (line 278)

Defined by Iterator interface

  • access: public
void next ()

Implementation of:
Iterator::next
readOnly (line 383)

Returns if this Zend_Config object is read only or not.

  • access: public
boolean readOnly ()
rewind (line 292)

Defined by Iterator interface

  • access: public
void rewind ()

Implementation of:
Iterator::rewind
setExtend (line 405)

Set an extend for Zend_Config_Writer

  • access: public
void setExtend (string $extendingSection, [string $extendedSection = null])
  • string $extendingSection
  • string $extendedSection
setReadOnly (line 368)

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.

  • access: public
void setReadOnly ()
toArray (line 197)

Return an associative array of the stored data.

  • access: public
array toArray ()
valid (line 304)

Defined by Iterator interface

  • access: public
boolean valid ()

Implementation of:
Iterator::valid
_arrayMergeRecursive (line 464)

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

  • access: protected
array _arrayMergeRecursive (mixed $firstArray, mixed $secondArray)
  • mixed $firstArray: First array
  • mixed $secondArray: Second array to merge into first array
_assertValidExtend (line 423)

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

  • throws: Zend_Config_Exception
  • access: protected
void _assertValidExtend (string $extendingSection, string $extendedSection)
  • string $extendingSection
  • string $extendedSection
_loadFileErrorHandler (line 447)

Handle any errors from simplexml_load_file or parse_ini_file

  • access: protected
void _loadFileErrorHandler (integer $errno, string $errstr, string $errfile, integer $errline)
  • integer $errno
  • string $errstr
  • string $errfile
  • integer $errline
__clone (line 179)

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

  • access: public
void __clone ()
__get (line 143)

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

  • access: public
mixed __get (string $name)
  • string $name
__isset (line 217)

Support isset() overloading on PHP 5.1

  • access: public
boolean __isset (string $name)
  • string $name
__set (line 157)

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

  • throws: Zend_Config_Exception
  • access: public
void __set (string $name, mixed $value)
  • string $name
  • mixed $value
__unset (line 229)

Support unset() overloading on PHP 5.1

  • throws: Zend_Config_Exception
  • access: public
void __unset (string $name)
  • string $name

Documentation generated on Mon, 21 Jun 2010 15:13:24 -0400 by phpDocumentor 1.4.3