aboutsummaryrefslogtreecommitdiff
path: root/src/bdrem/UserInterface.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/bdrem/UserInterface.php')
-rw-r--r--src/bdrem/UserInterface.php18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/bdrem/UserInterface.php b/src/bdrem/UserInterface.php
index ffaa279..cd1b7cc 100644
--- a/src/bdrem/UserInterface.php
+++ b/src/bdrem/UserInterface.php
@@ -3,22 +3,26 @@ namespace bdrem;
abstract class UserInterface
{
+ protected $config;
+
public function run()
{
- $cfg = new Config();
- $cfg->load();
- setlocale(LC_TIME, $cfg->locale);
- $source = $cfg->loadSource();
+ $this->config = new Config();
+ $this->config->load();
+ $this->config->date = date('Y-m-d');
+ setlocale(LC_TIME, $this->config->locale);
+ $source = $this->config->loadSource();
- $this->loadParameters($cfg);
+ $this->loadParameters($this->config);
$arEvents = $source->getEvents(
- date('Y-m-d'), $cfg->daysBefore, $cfg->daysAfter
+ $this->config->date,
+ $this->config->daysBefore, $this->config->daysAfter
);
usort($arEvents, '\\bdrem\\Event::compare');
$this->render($arEvents);
}
- protected function loadParameters($cfg)
+ protected function loadParameters()
{
}