Skip to content

Commit

Permalink
Merge pull request #58 from y1n0/patch-1
Browse files Browse the repository at this point in the history
Fix MariaDB version detection
  • Loading branch information
howyi committed Mar 21, 2024
2 parents 2f012f3 + c1cef96 commit e22fddf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Driver/DriverAllocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ public static function fromPDO(\PDO $PDO): DriverInterface
if (strpos($rawVersion, 'MariaDB') !== false) {
$type = self::TYPE_MARIA_DB;
$split = explode('-', $rawVersion);
$version = $split[1];
if (strtolower($split[1]) === 'mariadb') {
// MariaDB 11 ~
$version = $split[0];
} else {
$version = $split[1];
}
} elseif (strtolower($driverName) === 'mysql') {
$type = self::TYPE_MYSQL;
$version = $match[0];
Expand Down

0 comments on commit e22fddf

Please sign in to comment.