Class Zend_Config_Ini

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

Located in /Config/Ini.php (line 36)

Zend_Config
   |
   --Zend_Config_Ini
Variable Summary
Method Summary
 Zend_Config_Ini __construct (string $filename, mixed $section, [boolean|array $config = false])
 array _processExtends (array $iniArray, string $section, [array $config = array()])
 array _processKey (array $config, string $key, string $value)
Variables
string $_nestSeparator = '.' (line 43)

String that separates nesting levels of configuration data identifiers

  • access: protected

Inherited Variables

Inherited from Zend_Config

Zend_Config::$_allowModifications
Zend_Config::$_count
Zend_Config::$_data
Zend_Config::$_extends
Zend_Config::$_index
Zend_Config::$_loadedSection
Methods
Constructor __construct (line 84)

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

If any keys with $section are called "extends", then the section pointed to by the "extends" is then included into the properties. Note that the keys in $section will override any keys of the same name in the sections that have been included via "extends".

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] extends = all hostname = staging

after calling $data = new Zend_Config_Ini($file, 'staging'); then $data->hostname === "staging" $data->db->connection === "database"

The $config 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:

$config = array( 'allowModifications' => false, 'nestSeparator' => '->' );

  • throws: Zend_Config_Exception
  • access: public
Zend_Config_Ini __construct (string $filename, mixed $section, [boolean|array $config = false])
  • string $filename
  • mixed $section
  • boolean|array $config

Redefinition of:
Zend_Config::__construct()
Zend_Config provides a property based interface to an array. The data are read-only unless $allowModifications is set to true on construction.
_processExtends (line 161)

Helper function to process each element in the section and handle the "extends" inheritance keyword. Passes control to _processKey() to handle the "dot" sub-property syntax in each key.

  • throws: Zend_Config_Exception
  • access: protected
array _processExtends (array $iniArray, string $section, [array $config = array()])
  • array $iniArray
  • string $section
  • array $config
_processKey (line 191)

Assign the key's value to the property list. Handle the "dot" notation for sub-properties by passing control to processLevelsInKey().

  • throws: Zend_Config_Exception
  • access: protected
array _processKey (array $config, string $key, string $value)
  • array $config
  • string $key
  • string $value

Inherited Methods

Inherited From Zend_Config

 Zend_Config::__construct()
 Zend_Config::areAllSectionsLoaded()
 Zend_Config::asArray()
 Zend_Config::count()
 Zend_Config::current()
 Zend_Config::getSectionName()
 Zend_Config::key()
 Zend_Config::next()
 Zend_Config::rewind()
 Zend_Config::toArray()
 Zend_Config::valid()
 Zend_Config::_assertValidExtend()
 Zend_Config::__get()
 Zend_Config::__isset()
 Zend_Config::__set()

Documentation generated on Sun, 27 May 2007 23:24:57 -0700 by phpDocumentor 1.3.2