12 public function load()
14 $f = __DIR__ . '/../../data/bdrem.config.php';
15 if (file_exists($f)) {
16 return $this->loadFile($f);
19 throw new \Exception('No config file found');
22 protected function loadFile($filename)
25 $vars = get_defined_vars();
26 foreach ($vars as $k => $value) {
31 public function loadSource()
33 if ($this->source === null) {
34 throw new \Exception('No source defined');
37 $settings = $this->source;
38 $class = '\\bdrem\\Source_' . array_shift($settings);
40 return new $class($settings[0]);
43 public function get($varname, $default = '')
45 if (!isset($this->$varname) || $this->$varname == '') {
48 return $this->$varname;