Public Member Functions | Protected Member Functions | Protected Attributes

Zend_Config Class Reference

Public Member Functions

 __construct (array $array, $allowModifications=false)
 get ($name, $default=null)
 __get ($name)
 __set ($name, $value)
 __clone ()
 toArray ()
 __isset ($name)
 __unset ($name)
 count ()
 current ()
 key ()
 next ()
 rewind ()
 valid ()
 getSectionName ()
 areAllSectionsLoaded ()
 merge (Zend_Config $merge)
 setReadOnly ()
 readOnly ()
 getExtends ()
 setExtend ($extendingSection, $extendedSection=null)

Protected Member Functions

 _assertValidExtend ($extendingSection, $extendedSection)
 _loadFileErrorHandler ($errno, $errstr, $errfile, $errline)

Protected Attributes

 $_allowModifications
 $_index
 $_count
 $_data
 $_skipNextIteration
 $_loadedSection
 $_extends = array()
 $_loadFileErrorStr = null

Detailed Description

Definition at line 29 of file Config.php.


Constructor & Destructor Documentation

__construct ( array $  array,
allowModifications = false 
)

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:
array$array
boolean$allowModifications
Returns:
void

Definition at line 105 of file Config.php.


Member Function Documentation

__clone (  )

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

Returns:
void

Definition at line 179 of file Config.php.

__get ( name )

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

Parameters:
string$name
Returns:
mixed

Definition at line 143 of file Config.php.

__isset ( name )

Support isset() overloading on PHP 5.1

Parameters:
string$name
Returns:
boolean

Definition at line 217 of file Config.php.

__set ( name,
value 
)

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

Parameters:
string$name
mixed$value
Exceptions:
Zend_Config_Exception
Returns:
void

See also:
Zend_Config_Exception

Definition at line 157 of file Config.php.

__unset ( name )

Support unset() overloading on PHP 5.1

Parameters:
string$name
Exceptions:
Zend_Config_Exception
Returns:
void

See also:
Zend_Config_Exception

Definition at line 229 of file Config.php.

_assertValidExtend ( extendingSection,
extendedSection 
) [protected]

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

Parameters:
string$extendingSection
string$extendedSection
Exceptions:
Zend_Config_Exception
Returns:
void

See also:
Zend_Config_Exception

Definition at line 423 of file Config.php.

_loadFileErrorHandler ( errno,
errstr,
errfile,
errline 
) [protected]

Handle any errors from simplexml_load_file or parse_ini_file

Parameters:
integer$errno
string$errstr
string$errfile
integer$errline

Definition at line 447 of file Config.php.

areAllSectionsLoaded (  )

Returns true if all sections were loaded

Returns:
boolean

Definition at line 327 of file Config.php.

count (  )

Defined by Countable interface

Returns:
int

Definition at line 248 of file Config.php.

current (  )

Defined by Iterator interface

Returns:
mixed

Definition at line 258 of file Config.php.

get ( name,
default = null 
)

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

Parameters:
string$name
mixed$default
Returns:
mixed

Definition at line 128 of file Config.php.

getExtends (  )

Get the current extends

Returns:
array

Definition at line 393 of file Config.php.

getSectionName (  )

Returns the section name(s) loaded.

Returns:
mixed

Definition at line 314 of file Config.php.

key (  )

Defined by Iterator interface

Returns:
mixed

Definition at line 269 of file Config.php.

merge ( Zend_Config merge )

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

Parameters:
Zend_Config$merge
Returns:
Zend_Config

Definition at line 341 of file Config.php.

next (  )

Defined by Iterator interface

Definition at line 278 of file Config.php.

readOnly (  )

Returns if this Zend_Config object is read only or not.

Returns:
boolean

Definition at line 383 of file Config.php.

rewind (  )

Defined by Iterator interface

Definition at line 292 of file Config.php.

setExtend ( extendingSection,
extendedSection = null 
)

Set an extend for Zend_Config_Writer

Parameters:
string$extendingSection
string$extendedSection
Returns:
void

Definition at line 405 of file Config.php.

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.

Definition at line 368 of file Config.php.

toArray (  )

Return an associative array of the stored data.

Returns:
array

Definition at line 197 of file Config.php.

valid (  )

Defined by Iterator interface

Returns:
boolean

Definition at line 304 of file Config.php.


The documentation for this class was generated from the following file: