Prado\TApplicationConfiguration::loadFromXml PHP Метод

loadFromXml() публичный Метод

Parses the application configuration given in terms of a TXmlElement.
public loadFromXml ( $dom, $configPath )
    public function loadFromXml($dom, $configPath)
    {
        // application properties
        foreach ($dom->getAttributes() as $name => $value) {
            $this->_properties[$name] = $value;
            $this->_empty = false;
        }
        foreach ($dom->getElements() as $element) {
            switch ($element->getTagName()) {
                case 'paths':
                    $this->loadPathsXml($element, $configPath);
                    break;
                case 'modules':
                    $this->loadModulesXml($element, $configPath);
                    break;
                case 'services':
                    $this->loadServicesXml($element, $configPath);
                    break;
                case 'parameters':
                    $this->loadParametersXml($element, $configPath);
                    break;
                case 'include':
                    $this->loadExternalXml($element, $configPath);
                    break;
                default:
                    //throw new TConfigurationException('appconfig_tag_invalid',$element->getTagName());
                    break;
            }
        }
    }

Usage Example

Пример #1
0
 /**
  * Loads the configuration specific for application part
  * @param TXmlElement config xml element
  * @param string base path corresponding to this xml element
  */
 public function loadApplicationConfigurationFromXml($dom, $configPath)
 {
     $appConfig = new TApplicationConfiguration();
     $appConfig->loadFromXml($dom, $configPath);
     $this->_appConfigs[] = $appConfig;
 }
All Usage Examples Of Prado\TApplicationConfiguration::loadFromXml