--- nfo/php/libs/org.netfrag.glib/Application/Config.php 2003/02/03 04:59:29 1.2 +++ nfo/php/libs/org.netfrag.glib/Application/Config.php 2003/02/03 14:41:21 1.3 @@ -1,8 +1,12 @@ " . Dumper($initCfg) . "
"; $this->_store = $initCfg; } + + function merge() { + //$this->_store[run] = array_merge($this->_store['default'], $this->_store['init']); + foreach ($this->_store[_init][configkeys] as $configKey) { + //$this->_store[runtime] = array_merge($this->_store[runtime], $this->_store[$configKey]); + //$this->_store[runtime] = array_merge_recursive($this->_store[runtime], $this->_store[$configKey]); + $this->_store[runtime] = array_join_merge($this->_store[runtime], $this->_store[$configKey]); + } + //print Dumper($this); + } + + function getPart($var = null) { + //$this->merge(); + if ($var) { + return $this->getVar("runtime.$var"); + } else { + return $this->getVar("runtime"); + } + } + + function setVar($var, $val) { + //$this->_store[runtime][$var] = $val; + //$deep = new Data_Deep($this->_store[runtime]); + $deep = new Data_Deep($this->_store); + $deep->set($var, $val); + } + + function getVar($var) { + //$this->_store[runtime][$var] = $val; + //$deep = new Data_Deep($this->_store[runtime]); + $deep = new Data_Deep($this->_store); + return $deep->get($var); + } + } ?> \ No newline at end of file