Fixed a bug during installation

It set the "option" on the dbconfig and saved it to the config file as a string. Then it failed to load the file.
This commit is contained in:
Wruczek 2019-02-01 03:05:56 +01:00
parent 428e383c91
commit 972c2e6520
2 changed files with 6 additions and 7 deletions

View File

@ -43,14 +43,15 @@ if (!empty($_POST)) {
// try to connect only if dbconfig is defined
if (isset($dbconfig)) {
try {
// Enable DB exceptions instead of silent fails
$dbconfig += [
$errmodeException = [
"option" => [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
]
];
$db = new Medoo($dbconfig);
// Enable DB exceptions instead of silent fails, only for the Medoo
// object and not for the dbConfig, we dont want to get it saved
$db = new Medoo($dbconfig + $errmodeException);
$sqlfiles = [];

View File

@ -32,10 +32,8 @@ class DatabaseUtils {
$config = $this->configUtils->getDatabaseConfig();
// Enable DB exceptions instead of silent fails
$config += [
"option" => [
$config["config"] = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
]
];
$db = new Medoo($config);