/** * Create namespaces */ private function init() { $this->configurationArray = parse_ini_file($this->fileName, true); foreach ($this->configurationArray as $namespace => $properties) { $tempNamespace = new ConfigNamespace($namespace); if (!empty($this->section) && stripos($tempNamespace->getName(), $this->section) === false) { continue; } if ($tempNamespace->getExtends()) { $namespace = new ConfigNamespace($tempNamespace->getExtends()); $namespace->setProperty($this->configurationArray[$tempNamespace->getExtends()]); $tempNamespace->merge($namespace); } $tempNamespace->setProperty($properties); $this->namespaces[$tempNamespace->getName()] = $tempNamespace; } }
/** * Merge the root ConfigNode. * merge is handy in a case of extended namespace * @param ConfigNamespace $namespaceMergeWith */ public function merge(ConfigNamespace $namespaceMergeWith) { $this->rootNode = $namespaceMergeWith->getRootNode(); $this->rootNode->setName($this->getName()); }