diff --git a/inc/database.php b/inc/database.php index 8a47080..9ecc388 100644 --- a/inc/database.php +++ b/inc/database.php @@ -12,9 +12,18 @@ class Database { } function connect(Settings $cfg, $verify = true) { + $driver = $cfg->driver; + $host = $cfg->host; + $port = $cfg->port; + $database = $cfg->database; + $username = $cfg->username; + $password = $cfg->password; + $this->verify = $verify; $this->active_query = ""; - if ($cfg->driver === "pgsql") { + if (strtolower($driver) === "mariadb") { + $driver = "mysql"; + } elseif ($driver === "pgsql") { Database::$TRUE = "B'1'"; Database::$FALSE = "B'0'"; } @@ -27,13 +36,6 @@ class Database { $this->active_query = self::append_query($this->active_query, "silent=" . Database::$FALSE); } - $this->verify = $verify; - $driver = $cfg->driver; - $host = $cfg->host; - $port = $cfg->port; - $database = $cfg->database; - $username = $cfg->username; - $password = $cfg->password; if ($username === "" && $password === "") { redirect("error/unconfigured.php"); } diff --git a/inc/settings.php b/inc/settings.php index 78008ff..6a6aeb1 100644 --- a/inc/settings.php +++ b/inc/settings.php @@ -17,7 +17,7 @@ class Settings { // If you set a table prefix in config.yml, set it here as well $this->table_prefix = "litebans_"; - // Supported drivers: mysql, pgsql + // Supported drivers: mysql, mariadb, pgsql $this->driver = 'mysql'; // Server name, shown on the main page and on the header