From 92b7dd3335a6572debeacfb5faa82c63a5e67888 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 8 Jun 2018 20:03:25 +0200 Subject: Some minor fixes --- main/app/system/Bakery/DatabaseTest.php | 102 ++++++++++++++++---------------- 1 file changed, 51 insertions(+), 51 deletions(-) (limited to 'main/app/system/Bakery/DatabaseTest.php') diff --git a/main/app/system/Bakery/DatabaseTest.php b/main/app/system/Bakery/DatabaseTest.php index 91d2c2b..046c4c5 100644 --- a/main/app/system/Bakery/DatabaseTest.php +++ b/main/app/system/Bakery/DatabaseTest.php @@ -1,52 +1,52 @@ -ci->db; - - // Get config - $config = $this->ci->config; - - // Check params are valids - $dbParams = $config['db.default']; - if (!$dbParams) { - throw new \Exception("'default' database connection not found. Please double-check your configuration."); - } - - // Test database connection directly using PDO - try { - Capsule::connection()->getPdo(); - } catch (\PDOException $e) { - $message = "Could not connect to the database '{$dbParams['username']}@{$dbParams['host']}/{$dbParams['database']}':" . PHP_EOL; - $message .= "Exception: " . $e->getMessage() . PHP_EOL . PHP_EOL; - $message .= "Please check your database configuration and/or google the exception shown above and run command again."; - throw new \Exception($message); - } - - return TRUE; - } +ci->db; + + // Get config + $config = $this->ci->config; + + // Check params are valids + $dbParams = $config['db.default']; + if (!$dbParams) { + throw new \Exception("'default' database connection not found. Please double-check your configuration."); + } + + // Test database connection directly using PDO + try { + Capsule::connection()->getPdo(); + } catch (\PDOException $e) { + $message = "Could not connect to the database '{$dbParams['username']}@{$dbParams['host']}/{$dbParams['database']}':" . PHP_EOL; + $message .= "Exception: " . $e->getMessage() . PHP_EOL . PHP_EOL; + $message .= "Please check your database configuration and/or google the exception shown above and run command again."; + throw new \Exception($message); + } + + return TRUE; + } } \ No newline at end of file -- cgit v1.2.3