diff --git a/core/install.php b/core/install.php index cce71cf1..eff930c0 100644 --- a/core/install.php +++ b/core/install.php @@ -49,7 +49,7 @@ function get_dsn() { if (getenv("INSTALL_DSN")) { $dsn = getenv("INSTALL_DSN"); - } elseif (@$_POST["database_type"] == DatabaseDriverID::SQLITE) { + } elseif (@$_POST["database_type"] == DatabaseDriverID::SQLITE->value) { /** @noinspection PhpUnhandledExceptionInspection */ $id = bin2hex(random_bytes(5)); $dsn = "sqlite:data/shimmie.{$id}.sqlite"; @@ -99,9 +99,9 @@ function ask_questions() $drivers = PDO::getAvailableDrivers(); if ( - !in_array(DatabaseDriverID::MYSQL, $drivers) && - !in_array(DatabaseDriverID::PGSQL, $drivers) && - !in_array(DatabaseDriverID::SQLITE, $drivers) + !in_array(DatabaseDriverID::MYSQL->value, $drivers) && + !in_array(DatabaseDriverID::PGSQL->value, $drivers) && + !in_array(DatabaseDriverID::SQLITE->value, $drivers) ) { $errors[] = " No database connection library could be found; shimmie needs @@ -109,9 +109,9 @@ function ask_questions() "; } - $db_m = in_array(DatabaseDriverID::MYSQL, $drivers) ? '' : ""; - $db_p = in_array(DatabaseDriverID::PGSQL, $drivers) ? '' : ""; - $db_s = in_array(DatabaseDriverID::SQLITE, $drivers) ? '' : ""; + $db_m = in_array(DatabaseDriverID::MYSQL->value, $drivers) ? '' : ""; + $db_p = in_array(DatabaseDriverID::PGSQL->value, $drivers) ? '' : ""; + $db_s = in_array(DatabaseDriverID::SQLITE->value, $drivers) ? '' : ""; $warn_msg = $warnings ? "

Warnings

".implode("\n

", $warnings) : ""; $err_msg = $errors ? "

Errors

".implode("\n

", $errors) : "";