summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2019-06-24 11:36:05 +0000
committerAleksander Machniak <machniak@kolabsys.com>2019-06-24 11:36:05 +0000
commit35251088ee10e5fb2ee7bc02e0d92aa9421a8fa8 (patch)
treefa41888a1799f77080b5de783d72b4baefcb42d4 /lib
parent89b1896ae72f242c4a58a6977eb11abf5f571648 (diff)
downloadwebadmin-35251088ee10e5fb2ee7bc02e0d92aa9421a8fa8.tar.gz
Log an error when SQL DSN is empty
Diffstat (limited to 'lib')
-rw-r--r--lib/SQL.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/SQL.php b/lib/SQL.php
index 102f59d..796f106 100644
--- a/lib/SQL.php
+++ b/lib/SQL.php
@@ -78,6 +78,11 @@ class SQL
$conf = Conf::get_instance();
$dsn = $conf->get($conn_name, 'sql_uri');
+ if (empty($dsn)) {
+ Log::error("Configuration error. Empty DSN ($conn_name/sql_uri)");
+ exit;
+ }
+
$driver = strtolower(substr($dsn, 0, strpos($dsn, ':')));
$driver_map = array(
'sqlite2' => 'sqlite',