11 public $stopOnEmpty = false;
12 public $cfgFileExists;
14 public function load()
16 $f = __DIR__ . '/../../data/bdrem.config.php';
17 if (file_exists($f)) {
18 $this->cfgFileExists = true;
19 return $this->loadFile($f);
22 $this->cfgFileExists = false;
25 protected function loadFile($filename)
28 $vars = get_defined_vars();
29 foreach ($vars as $k => $value) {
34 public function loadSource()
36 if ($this->source === null) {
37 throw new \Exception('No source defined');
40 $settings = $this->source;
41 $class = '\\bdrem\\Source_' . array_shift($settings);
43 return new $class($settings[0]);
46 public function setDate($date)
49 $this->date = date('Y-m-d');
51 $dt = new \DateTime($date);
52 $this->date = $dt->format('Y-m-d');
56 public function get($varname, $default = '')
58 if (!isset($this->$varname) || $this->$varname == '') {
61 return $this->$varname;