git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit 48efdc35 authored by mmn's avatar mmn

Merge branch 'check-connection-on-install' into 'master'

Check DB connection before any possible use

This is to avoid an exception when enabling 'pgsql' backend

See merge request !121
parents 844fe392 3138fa0b
Pipeline #51 skipped
......@@ -285,6 +285,11 @@ abstract class Installer
$this->updateStatus("Checking database...");
$conn = $this->connectDatabase($dsn);
if (!$conn instanceof DB_common) {
// Is not the right instance
throw new Exception('Cannot connect to database: ' . $conn->getMessage());
}
// ensure database encoding is UTF8
if ($this->dbtype == 'mysql') {
// @fixme utf8m4 support for mysql 5.5?
......@@ -299,11 +304,6 @@ abstract class Installer
}
}
if (!$conn instanceof DB_common) {
// Is not the right instance
throw new Exception('Cannot connect to database: ' . $conn->getMessage());
}
$res = $this->updateStatus("Creating database tables...");
if (!$this->createCoreTables($conn)) {
$this->updateStatus("Error creating tables.", true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment