10 public function load()
12 $f = __DIR__ . '/../../data/bdrem.config.php';
13 if (file_exists($f)) {
14 return $this->loadFile($f);
17 throw new \Exception('No config file found');
20 protected function loadFile($filename)
23 $this->source = $source;
24 $this->daysBefore = $daysBefore;
25 $this->daysAfter = $daysAfter;
28 public function loadSource()
30 if ($this->source === null) {
31 throw new \Exception('No source defined');
34 $settings = $this->source;
35 $class = '\\bdrem\\Source_' . array_shift($settings);
37 return new $class($settings[0]);
38 //$rm = new \ReflectionMethod($class, '__construct');
39 //return $rm->invokeArgs(null, $settings);
40 //return call_user_func_array($class . '::__construct', $settings);