Index: Ini.php =================================================================== --- Ini.php (revision 1187) +++ Ini.php (working copy) @@ -73,12 +73,31 @@ throw new Zend_Config_Exception('Section is not set'); } - $iniArray = parse_ini_file($filename, true); - if (!isset($iniArray[$section])) { - throw new Zend_Config_Exception("Section '$section' cannot be found in $filename"); - } - - parent::__construct($this->_processExtends($iniArray, $section), $allowModifications); + $iniArray = parse_ini_file($filename, true); + $preProcessedArray = array(); + foreach($iniArray as $key=>$data) + { + $bits = explode(':', $key); + $numberOfBits = count($bits); + $thisSection = trim($bits[0]); + switch (count($bits)) { + case 1: + $preProcessedArray[$thisSection] = $data; + break; + case 2: + $extendedSection = trim($bits[1]); + $preProcessedArray[$thisSection] = array_merge(array('extends'=>$extendedSection), $data); + break; + + default: + throw new Zend_Config_Exception("Section '$thisSection' cannot be extended more than once in $filename"); + } + } + if (!isset($preProcessedArray[$section])) { + throw new Zend_Config_Exception("Section '$section' cannot be found in $filename"); + } + + parent::__construct($this->_processExtends($preProcessedArray, $section), $allowModifications); } /**