protected function _sortRootElements(Zend_Config $config)
    {
        $configArray = $config->toArray();
        $sections = array();

        // remove sections from config array
        foreach ($configArray as $key => $value) {
            if (is_array($value)) {
                $sections[$key] = $value;
                unset($configArray[$key]);
            }
        }

        // readd sections to the end
        foreach ($sections as $key => $value) {
            $configArray[$key] = $value;
        }

        return new Zend_Config($configArray);
    }
protected function _sortRootElements(Zend_Config $config)
    {
        $configArray = $config->toArray();
        $sections = array();

        // remove sections from config array
        foreach ($configArray as $key => $value) {
            if (is_array($value)) {
                $sections[$key] = $value;
                unset($configArray[$key]);
            }
        }

        // readd sections to the end
        foreach ($sections as $key => $value) {
            $configArray[$key] = $value;
        }

        return new Zend_Config($configArray);
    }
protected function _sortRootElements ( Zend_Config $ config ) { $ configArray = $ config -> toArray ( ) ; $ sections = array ( ) ; // remove sections from config array foreach ( $ configArray as $ key => $ value ) { if ( is_array ( $ value ) ) { $ sections [ $ key ] = $ value ; unset ( $ configArray [ $ key ] ) ; } } // readd sections to the end foreach ( $ sections as $ key => $ value ) { $ configArray [ $ key ] = $ value ; } return new Zend_Config ( $ configArray ) ; }
Root elements that are not assigned to any section needs to be
on the top of config.

@see    http://framework.zend.com/issues/browse/ZF-6289
@param  Zend_Config
@return Zend_Config
Root elements that are not assigned to any section needs to be on the top of config .