196ca18a3d8052e06054e38c8e53fc8f3311aa82
[bdrem.git] / src / bdrem / Cli.php
1 <?php
2 namespace bdrem;
3
4 class Cli
5 {
6     public function run()
7     {
8         $cfg = new Config();
9         $cfg->load();
10         setlocale(LC_TIME, $cfg->locale);
11         $source = $cfg->loadSource();
12
13         $arEvents = $source->getEvents(
14             date('Y-m-d'), $cfg->daysBefore, $cfg->daysAfter
15         );
16         usort($arEvents, '\\bdrem\\Event::compare');
17
18         $r = new Renderer_Console();
19         echo $r->render($arEvents);
20     }
21 }
22 ?>