Esempio n. 1
0
 /**
  * Set Config sets config vars
  *
  * @param array $config A config assoc array.
  * @return true on success, false otherwise
  **/
 function setConfig($config)
 {
     foreach ((array) $config as $key => $value) {
         $this->config[$key] = $value;
     }
     $this->Store = HDStore::getInstance();
     $this->Store->setConfig($this->config);
     $this->Extra = new HDExtra($this->config);
 }
Esempio n. 2
0
 /**
  * Set Config variables
  *
  * @param array $config A config array
  * @return boolean true on success, false otherwise
  **/
 function setConfig($config)
 {
     $this->Store = HDStore::getInstance();
     $this->Store->setConfig($config);
     return true;
 }
Esempio n. 3
0
 /**
  * Set config file
  *
  * @param array $config An assoc array of config data
  * @return true on success, false otherwise
  **/
 function setConfig($cfg)
 {
     $config = array();
     if (is_array($cfg)) {
         $config = $cfg;
     } elseif (is_string($cfg)) {
         // Sets $hdconfig
         require $cfg;
         $config = $hdconfig;
     }
     foreach ($config as $key => $value) {
         $this->config[$key] = $value;
     }
     if (empty($this->config['filesdir'])) {
         $this->config['filesdir'] = dirname(__FILE__);
     }
     $this->Store = HDStore::getInstance();
     $this->Store->setConfig($this->config, true);
     $this->Cache = new HDCache($this->config);
     $this->Device = new HDDevice($this->config);
     return true;
 }