summaryrefslogtreecommitdiff
path: root/lib/lib_install.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-12-26 16:33:47 +0100
committerGravatar GitHub <noreply@github.com> 2016-12-26 16:33:47 +0100
commit5f637bd816b7323885bfe1751a1724ee59a822f6 (patch)
tree67028e45792c575c25c92616633f64cc7a4a13eb /lib/lib_install.php
parentc3d2496bb3ce665faf4a0f24a4aa2ab300ab56d3 (diff)
parent109f63be2620cf108efdfebd43f491e2720c824a (diff)
Merge pull request #1399 from FreshRSS/dev1.6.2
Release 1.6.2
Diffstat (limited to 'lib/lib_install.php')
-rw-r--r--lib/lib_install.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/lib_install.php b/lib/lib_install.php
index 0e7b7f036..c5cae4293 100644
--- a/lib/lib_install.php
+++ b/lib/lib_install.php
@@ -15,6 +15,7 @@ function checkRequirements() {
$pdo = $pdo_mysql || $pdo_sqlite || $pdo_pgsql;
$pcre = extension_loaded('pcre');
$ctype = extension_loaded('ctype');
+ $fileinfo = extension_loaded('fileinfo');
$dom = class_exists('DOMDocument');
$xml = function_exists('xml_parser_create');
$json = function_exists('json_encode');
@@ -34,6 +35,7 @@ function checkRequirements() {
'pdo' => $pdo ? 'ok' : 'ko',
'pcre' => $pcre ? 'ok' : 'ko',
'ctype' => $ctype ? 'ok' : 'ko',
+ 'fileinfo' => $fileinfo ? 'ok' : 'ko',
'dom' => $dom ? 'ok' : 'ko',
'xml' => $xml ? 'ok' : 'ko',
'json' => $json ? 'ok' : 'ko',
@@ -42,7 +44,7 @@ function checkRequirements() {
'users' => $users ? 'ok' : 'ko',
'favicons' => $favicons ? 'ok' : 'ko',
'http_referer' => $http_referer ? 'ok' : 'ko',
- 'all' => $php && $minz && $curl && $pdo && $pcre && $ctype && $dom && $xml &&
+ 'all' => $php && $minz && $curl && $pdo && $pcre && $ctype && $fileinfo && $dom && $xml &&
$data && $cache && $users && $favicons && $http_referer ?
'ok' : 'ko'
);
@@ -54,8 +56,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 +101,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;