Skip to content
This repository has been archived by the owner on Aug 1, 2021. It is now read-only.

Commit

Permalink
Testing for missing config file
Browse files Browse the repository at this point in the history
  • Loading branch information
o-alquimista committed Mar 18, 2020
1 parent 452cff7 commit 025c1ff
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Fragments/Component/PDOBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function getConnection(): \PDO
);
} catch(\PDOException $error) {
// FIXME: throw server error exception
exit;
}

return $pdo;
Expand All @@ -48,6 +49,12 @@ private function getConfig(): array
{
$config = parse_ini_file('../config/database.ini');

if (false === $config) {
// FIXME: throw server error exception
exit;
}

// FIXME: test for missing configuration keys
return $config;
}
}

0 comments on commit 025c1ff

Please sign in to comment.