aboutsummaryrefslogtreecommitdiff
path: root/lib/lib_install.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-11-06 14:04:06 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-11-06 14:04:06 +0100
commit829d9997d31929b45384808f7cca343edb00b0d2 (patch)
tree18e07a53a06056f4d0710f70c1fed255fc329baa /lib/lib_install.php
parent92910c212b4d2796c222c7891ea319fde3149525 (diff)
Fix small bugs in install
Small fixes in install (e.g. better check that DB password works)
Diffstat (limited to 'lib/lib_install.php')
-rw-r--r--lib/lib_install.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/lib_install.php b/lib/lib_install.php
index 0e7b7f036..dd8090bcd 100644
--- a/lib/lib_install.php
+++ b/lib/lib_install.php
@@ -54,8 +54,8 @@ function generateSalt() {
function checkDb(&$dbOptions) {
$dsn = '';
+ $driver_options = null;
try {
- $driver_options = null;
switch ($dbOptions['type']) {
case 'mysql':
include_once(APP_PATH . '/SQL/install.sql.mysql.php');
@@ -99,8 +99,12 @@ function checkDb(&$dbOptions) {
default:
return false;
}
+
+ $c = new PDO($dsn, $dbOptions['user'], $dbOptions['password'], $driver_options);
+ $res = $c->query('SELECT 1');
} catch (PDOException $e) {
$dsn = '';
+ syslog(LOG_DEBUG, 'FreshRSS SQL warning: ' . $e->getMessage());
$dbOptions['error'] = $e->getMessage();
}
$dbOptions['dsn'] = $dsn;