diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-10-17 22:31:04 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-10-17 22:31:04 -0400 |
commit | ad55e6ede5fab449c91aced8c1a42ae4ee7b809c (patch) | |
tree | 744fc7ba3d82c830dd90ec4de992385607b9a832 /app/ServiceProvider/DatabaseProvider.php | |
parent | 09da289c2fb18475f372bee24e885617da484e0b (diff) |
Remove exit expression in database provider
Diffstat (limited to 'app/ServiceProvider/DatabaseProvider.php')
-rw-r--r-- | app/ServiceProvider/DatabaseProvider.php | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/app/ServiceProvider/DatabaseProvider.php b/app/ServiceProvider/DatabaseProvider.php index 43c4b813..b2115644 100644 --- a/app/ServiceProvider/DatabaseProvider.php +++ b/app/ServiceProvider/DatabaseProvider.php @@ -2,6 +2,8 @@ namespace Kanboard\ServiceProvider; +use LogicException; +use RuntimeException; use Pimple\Container; use Pimple\ServiceProviderInterface; use PicoDb\Database; @@ -27,24 +29,21 @@ class DatabaseProvider implements ServiceProviderInterface case 'sqlite': $db = $this->getSqliteInstance(); break; - case 'mysql': $db = $this->getMysqlInstance(); break; - case 'postgres': $db = $this->getPostgresInstance(); break; - default: - die('Database driver not supported'); + throw new LogicException('Database driver not supported'); } if ($db->schema()->check(\Schema\VERSION)) { return $db; } else { $errors = $db->getLogMessages(); - die('Unable to migrate database schema: <br/><br/><strong>'.(isset($errors[0]) ? $errors[0] : 'Unknown error').'</strong>'); + throw new RuntimeException('Unable to migrate database schema: '.(isset($errors[0]) ? $errors[0] : 'Unknown error')); } } |