diff --git a/.gitignore b/.gitignore index 9b1dffd..319be8d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +sql_config.php *.sqlite diff --git a/dev.sh b/dev.sh index 21963b7..688c477 100755 --- a/dev.sh +++ b/dev.sh @@ -1,3 +1,4 @@ #!/bin/sh which -s sqlite3 && test \! -e pvv.sqlite && sqlite3 pvv.sqlite < pvv.sql +test \! -e sql_config.php && cp sql_config_example.php sql_config.php php -S [::]:1080 -t www/ diff --git a/sql_config_example.php b/sql_config_example.php new file mode 100644 index 0000000..99c13c9 --- /dev/null +++ b/sql_config_example.php @@ -0,0 +1,5 @@ +pdo = new PDO($dsn, $username, $password); - $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + public function __construct(PDO $pdo) { + $this->pdo = $pdo; } public function getNextEventFrom(DateTimeImmutable $date) { diff --git a/www/index.php b/www/index.php index 4cd56ab..a489444 100644 --- a/www/index.php +++ b/www/index.php @@ -1,7 +1,14 @@ setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); +$agenda = new \pvv\side\Agenda([ + new \pvv\side\social\NerdepitsaActivity, + new \pvv\side\social\AnimekveldActivity, + new \pvv\side\DBActivity($pdo), + ]); ?> ?> Programvareverkstedet @@ -44,11 +51,6 @@ date_default_timezone_set('Europe/Oslo'); - getNextDays() as $period => $events) if ($events && $counter1 < 2 && $counter2 < 10) { $counter1++ ?>
  • getStart()->format('Y-m-d'); ?>