/[cvs]/nfo/php/libs/org.netfrag.glib/Application/Config.php
ViewVC logotype

Diff of /nfo/php/libs/org.netfrag.glib/Application/Config.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by joko, Mon Feb 3 14:41:21 2003 UTC revision 1.4 by joko, Sun Feb 9 17:03:35 2003 UTC
# Line 3  Line 3 
3  //  $Id$  //  $Id$
4  // ---------------------------------------------------------------------------  // ---------------------------------------------------------------------------
5  //  $Log$  //  $Log$
6    //  Revision 1.4  2003/02/09 17:03:35  joko
7    //  + additional get-/setter methods
8    //
9  //  Revision 1.3  2003/02/03 14:41:21  joko  //  Revision 1.3  2003/02/03 14:41:21  joko
10  //  + get- and set-methods to access configuration variables  //  + get- and set-methods to access configuration variables
11  //  + recursive merging mechanism  //  + recursive merging mechanism
# Line 45  class Application_Config { Line 48  class Application_Config {
48        
49    function merge() {    function merge() {
50      //$this->_store[run] = array_merge($this->_store['default'], $this->_store['init']);      //$this->_store[run] = array_merge($this->_store['default'], $this->_store['init']);
51    //print Dumper($this);
52      foreach ($this->_store[_init][configkeys] as $configKey) {      foreach ($this->_store[_init][configkeys] as $configKey) {
53        //$this->_store[runtime] = array_merge($this->_store[runtime], $this->_store[$configKey]);        //$this->_store[runtime] = array_merge($this->_store[runtime], $this->_store[$configKey]);
54        //$this->_store[runtime] = array_merge_recursive($this->_store[runtime], $this->_store[$configKey]);        //$this->_store[runtime] = array_merge_recursive($this->_store[runtime], $this->_store[$configKey]);
# Line 53  class Application_Config { Line 57  class Application_Config {
57      //print Dumper($this);      //print Dumper($this);
58    }    }
59        
60    function getPart($var = null) {    function get($var = null) {
61      //$this->merge();      //$this->merge();
62      if ($var) {      if ($var) {
63        return $this->getVar("runtime.$var");        return $this->get_absolute("runtime.$var");
64      } else {      } else {
65        return $this->getVar("runtime");        return $this->get_absolute("runtime");
66      }      }
67    }    }
68        
69    function setVar($var, $val) {    function set_absolute($var, $val) {
70      //$this->_store[runtime][$var] = $val;      //$this->_store[runtime][$var] = $val;
71      //$deep = new Data_Deep($this->_store[runtime]);      //$deep = new Data_Deep($this->_store[runtime]);
72      $deep = new Data_Deep($this->_store);      $deep = new Data_Deep($this->_store);
73      $deep->set($var, $val);      $deep->set($var, $val);
74    }    }
75        
76    function getVar($var) {    function get_absolute($var) {
77      //$this->_store[runtime][$var] = $val;      //$this->_store[runtime][$var] = $val;
78      //$deep = new Data_Deep($this->_store[runtime]);      //$deep = new Data_Deep($this->_store[runtime]);
79      $deep = new Data_Deep($this->_store);      $deep = new Data_Deep($this->_store);

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed