13 public function load()
15 $f = __DIR__ . '/../../data/bdrem.config.php';
16 if (file_exists($f)) {
17 return $this->loadFile($f);
20 throw new \Exception('No config file found');
23 protected function loadFile($filename)
26 $vars = get_defined_vars();
27 foreach ($vars as $k => $value) {
32 public function loadSource()
34 if ($this->source === null) {
35 throw new \Exception('No source defined');
38 $settings = $this->source;
39 $class = '\\bdrem\\Source_' . array_shift($settings);
41 return new $class($settings[0]);
44 public function setDate($date)
47 $this->date = date('Y-m-d');
49 $dt = new \DateTime($date);
50 $this->date = $dt->format('Y-m-d');
54 public function get($varname, $default = '')
56 if (!isset($this->$varname) || $this->$varname == '') {
59 return $this->$varname;