Zend_Config::_assertValidExtend PHP Method

_assertValidExtend() protected method

Throws an exception if $extendingSection may not extend $extendedSection, and tracks the section extension if it is valid.
protected _assertValidExtend ( string $extendingSection, string $extendedSection ) : void
$extendingSection string
$extendedSection string
return void
    protected function _assertValidExtend($extendingSection, $extendedSection)
    {
        // detect circular section inheritance
        $extendedSectionCurrent = $extendedSection;
        while (array_key_exists($extendedSectionCurrent, $this->_extends)) {
            if ($this->_extends[$extendedSectionCurrent] == $extendingSection) {
                /** @see Zend_Config_Exception */
                require_once 'Zend/Config/Exception.php';
                throw new Zend_Config_Exception('Illegal circular inheritance detected');
            }
            $extendedSectionCurrent = $this->_extends[$extendedSectionCurrent];
        }
        // remember that this section extends another section
        $this->_extends[$extendingSection] = $extendedSection;
    }