public function load($name = null) { $conf = !$this->isDefault() ? $this->_confname : $this->_confname . ".default"; parent::load($conf); $alt = false; if ($this->hasSection('USE_ALTERNATE')) { $this->_confname = $this->get("USE_ALTERNATE", "file"); $alt = true; } parent::load($this->_confname); if ($alt) { $this->set("USE_ALTERNATE", "file", $this->_confname); } // Migration from 0.6.17 if ($this->hasSection("PLUGINS_DATASOURCES")) { $pluginsconf = new DirbasedConfig($this->getConfDir(), "plugins.conf"); $arr = array("PLUGINS_DATASOURCES" => $this->getSection("PLUGINS_DATASOURCES"), "PLUGINS_GENERAL" => $this->getSection("PLUGINS_GENERAL"), "PLUGINS_ITEMPROCESSORS" => $this->getSection("PLUGINS_ITEMPROCESSORS")); $pluginsconf->setProps($arr); $pluginsconf->save(); $this->removeSection("PLUGINS_DATASOURCES"); $this->removeSection("PLUGINS_GENERAL"); $this->removeSection("PLUGINS_ITEMPROCESSORS"); $this->save(); } // Migration step (to percent) , 0.7beta4 if ($this->get("GLOBAL", "step", 0) == 0 || floatval($this->get("GLOBAL", "step", 0.5)) > 20) { $this->set("GLOBAL", "step", 0.5); $this->save(); } return $this; }
public function load($name = null) { if ($name != null) { $this->inifile = $name; } if (file_exists($this->inifile)) { $conf = $this->inifile; $this->_default = false; parent::load($conf); $this->_confname = basename($conf); if ($this->_confname != $conf) { $this->_basedir = dirname($conf); } } else { $this->_default = true; } return $this; }
public function load($name = null) { if ($name == null) { $conf = !$this->isDefault() ? $this->_confname : $this->_confname . ".default"; } else { $conf = $name; } parent::load($conf); $this->_confname = basename($conf); if ($this->_confname != $conf) { $this->_basedir = dirname($conf); } if ($this->hasSection('USE_ALTERNATE')) { $alternate = $this->get("USE_ALTERNATE", "file"); $this->_confname = basename($alternate); $this->_basedir = dirname($alternate); $alt = true; $this->set("USE_ALTERNATE", "file", $this->_confname); parent::load($this->_confname); } return $this; }