|
|
@ -1495,6 +1495,7 @@ function db_connect_with_errors() {
|
|
|
|
die("<p style='color: red'>FATAL Error:<br />Invalid \$CONF['database_type']! Please fix your config.inc.php!</p>");
|
|
|
|
die("<p style='color: red'>FATAL Error:<br />Invalid \$CONF['database_type']! Please fix your config.inc.php!</p>");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
if ($username_password) {
|
|
|
|
if ($username_password) {
|
|
|
|
$link = new PDO($dsn, Config::read_string('database_user'), Config::read_string('database_password'), $options);
|
|
|
|
$link = new PDO($dsn, Config::read_string('database_user'), Config::read_string('database_password'), $options);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -1506,7 +1507,10 @@ function db_connect_with_errors() {
|
|
|
|
$link->exec($q);
|
|
|
|
$link->exec($q);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (PDOException $e) {
|
|
|
|
|
|
|
|
$error_text = 'PDO exception: '. $e->getMessage();
|
|
|
|
|
|
|
|
error_log($error_text);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return array($link, $error_text);
|
|
|
|
return array($link, $error_text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|