Class Zend_Config_Ini

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

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

Zend_Config
   |
   --Zend_Config_Ini
Variable Summary
Method Summary
 void __construct (string $filename, [string|null $section = null], [boolean|array $options = false])
 array _loadIniFile (string $filename)
 array _parseIniFile (string $filename)
 array _processKey (array $config, string $key, string $value)
 array _processSection (array $iniArray, string $section, [array $config = array()])
Variables
string $_nestSeparator = '.' (line 42)

String that separates nesting levels of configuration data identifiers

  • access: protected
string $_sectionSeparator = ':' (line 49)

String that separates the parent section name

  • access: protected
boolean $_skipExtends = false (line 56)

Whether to skip extends or not

  • 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
Zend_Config::$_loadFileErrorStr
Zend_Config::$_skipNextIteration
Methods
Constructor __construct (line 100)

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

If the section name contains a ":" then the section name to the right is loaded and included into the properties. Note that the keys in this $section will override any keys of the same name in the sections that have been included via ":".

If the $section is null, then all sections in the ini file are loaded.

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

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

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

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

  • throws: Zend_Config_Exception
  • access: public
void __construct (string $filename, [string|null $section = null], [boolean|array $options = false])
  • string $filename
  • string|null $section
  • boolean|array $options

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.
_loadIniFile (line 199)

Load the ini file and preprocess the section separator (':' in the

section name (that is used for section extension) so that the resultant array has the correct section names and the extension information is stored in a sub-key called ';extends'. We use ';extends' as this can never be a valid key name in an INI file that has been loaded using parse_ini_file().

  • throws: Zend_Config_Exception
  • access: protected
array _loadIniFile (string $filename)
  • string $filename
_parseIniFile (line 169)

Load the INI file from disk using parse_ini_file(). Use a private error handler to convert any loading errors into a Zend_Config_Exception

  • throws: Zend_Config_Exception
  • access: protected
array _parseIniFile (string $filename)
  • string $filename
_processKey (line 276)

Assign the key's value to the property list. Handles the nest separator for sub-properties.

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

Process each element in the section and handle the ";extends" inheritance key. Passes control to _processKey() to handle the nest separator sub-property syntax that may be used within the key name.

  • throws: Zend_Config_Exception
  • access: protected
array _processSection (array $iniArray, string $section, [array $config = array()])
  • array $iniArray
  • string $section
  • array $config

Inherited Methods

Inherited From Zend_Config

 Zend_Config::__construct()
 Zend_Config::areAllSectionsLoaded()
 Zend_Config::count()
 Zend_Config::current()
 Zend_Config::get()
 Zend_Config::getExtends()
 Zend_Config::getSectionName()
 Zend_Config::key()
 Zend_Config::merge()
 Zend_Config::next()
 Zend_Config::readOnly()
 Zend_Config::rewind()
 Zend_Config::setExtend()
 Zend_Config::setReadOnly()
 Zend_Config::toArray()
 Zend_Config::valid()
 Zend_Config::_arrayMergeRecursive()
 Zend_Config::_assertValidExtend()
 Zend_Config::_loadFileErrorHandler()
 Zend_Config::__clone()
 Zend_Config::__get()
 Zend_Config::__isset()
 Zend_Config::__set()
 Zend_Config::__unset()

Documentation generated on Mon, 21 Jun 2010 15:29:06 -0400 by phpDocumentor 1.4.3