Beispiel #1
0
 /**
  * @param string $xml
  * @param string|null $section
  */
 public function __construct($xml, $section = null)
 {
     $config = array();
     $elements = Aix_File_XML::read($xml);
     if ($elements[0]['tag'] == self::$tag) {
         $elements = $elements[0]['elements'];
     }
     foreach ($elements as $element) {
         $value = $this->parse($element);
         if (isset($element['attributes']['extends']) && isset($config[$element['attributes']['extends']])) {
             $value = $this->merge($config[$element['attributes']['extends']], $value);
         }
         $config[$element['tag']] = $value;
     }
     if (!(null === $section) && isset($config[$section])) {
         $config = $config[$section];
     }
     parent::__construct($config);
 }
Beispiel #2
0
 /**
  * @param string $file
  */
 public function __construct($file)
 {
     parent::__construct(require $file);
 }