Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
added specifics for MariaDB
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancoisChaumont committed May 15, 2020
1 parent d15929d commit 94231f2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ class Db
{
// DBMS handled
const MYSQL = 'mysql';
const MARIADB = 'mysql';
const POSTGRESQL = 'pgsql';

const DBMSs = [
self::MYSQL,
self::MARIADB,
self::POSTGRESQL
];

Expand Down Expand Up @@ -172,7 +174,7 @@ public function connect(): void
// reset error message
$this->errMessage = '';

$charset = $this->dbms == self::MYSQL && $this->charset != '' ? "charset={$this->charset}" : '';
$charset = in_array($this->dbms, [self::MYSQL, self::MARIADB]) && $this->charset != '' ? "charset={$this->charset}" : '';
$port = $this->port > 0 ? "port={$this->port}" : '';

try {
Expand Down

0 comments on commit 94231f2

Please sign in to comment.