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.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/bdrem/UserInterface.php b/src/bdrem/UserInterface.php
new file mode 100644
index 0000000..ffaa279
--- /dev/null
+++ b/src/bdrem/UserInterface.php
@@ -0,0 +1,27 @@
+<?php
+namespace bdrem;
+
+abstract class UserInterface
+{
+ public function run()
+ {
+ $cfg = new Config();
+ $cfg->load();
+ setlocale(LC_TIME, $cfg->locale);
+ $source = $cfg->loadSource();
+
+ $this->loadParameters($cfg);
+ $arEvents = $source->getEvents(
+ date('Y-m-d'), $cfg->daysBefore, $cfg->daysAfter
+ );
+ usort($arEvents, '\\bdrem\\Event::compare');
+ $this->render($arEvents);
+ }
+
+ protected function loadParameters($cfg)
+ {
+ }
+
+ abstract protected function render($arEvents);
+}
+?> \ No newline at end of file