_processExtends example

// Reset original static state of ignore_constants         self::setIgnoreConstants($staticIgnoreConstants);

        if (null === $config) {
            // decode failed             throw new Zend_Config_Exception("Error parsing YAML data");
        }

        if (null === $section) {
            $dataArray = array();
            foreach ($config as $sectionName => $sectionData) {
                $dataArray[$sectionName] = $this->_processExtends($config$sectionName);
            }
            parent::__construct($dataArray$allowModifications);
        } elseif (is_array($section)) {
            $dataArray = array();
            foreach ($section as $sectionName) {
                if (!isset($config[$sectionName])) {
                    throw new Zend_Config_Exception(sprintf(
                        'Section "%s" cannot be found', 
                        implode(' ', (array)$section)
                    ));
                }

                
// Parse/decode         $config = Zend_Json::decode($json);

        if (null === $config) {
            // decode failed             throw new Zend_Config_Exception("Error parsing JSON data");
        }

        if ($section === null) {
            $dataArray = array();
            foreach ($config as $sectionName => $sectionData) {
                $dataArray[$sectionName] = $this->_processExtends($config$sectionName);
            }

            parent::__construct($dataArray$allowModifications);
        } elseif (is_array($section)) {
            $dataArray = array();
            foreach ($section as $sectionName) {
                if (!isset($config[$sectionName])) {
                    throw new Zend_Config_Exception(sprintf('Section "%s" cannot be found', $sectionName));
                }

                $dataArray = array_merge($this->_processExtends($config$sectionName)$dataArray);
            }


        restore_error_handler();
        // Check if there was a error while loading file         if ($this->_loadFileErrorStr !== null) {
            throw new Zend_Config_Exception($this->_loadFileErrorStr);
        }

        if ($section === null) {
            $dataArray = array();
            foreach ($config as $sectionName => $sectionData) {
                $dataArray[$sectionName] = $this->_processExtends($config$sectionName);
            }

            parent::__construct($dataArray$allowModifications);
        } else if (is_array($section)) {
            $dataArray = array();
            foreach ($section as $sectionName) {
                if (!isset($config->$sectionName)) {
                    throw new Zend_Config_Exception("Section '$sectionName' cannot be found in $xml");
                }

                $dataArray = array_merge($this->_processExtends($config$sectionName)$dataArray);
            }
Home | Imprint | This part of the site doesn't use cookies.