From: Jakub Vrana Date: Sun, 16 Mar 2025 16:39:11 +0000 (+0100) Subject: MariaDB: Display MariaDB instead of MySQL X-Git-Tag: v5.0.6~28 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=8353bd48deca71c7f2b39ee079bcd2080b26f287;p=adminer.git MariaDB: Display MariaDB instead of MySQL --- diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index 91c07414..a3c23f1e 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -1,7 +1,7 @@ "MySQL") + $drivers; +$drivers = array("server" => "MySQL / MariaDB") + $drivers; if (!defined('Adminer\DRIVER')) { define('Adminer\DRIVER', "server"); // server - backwards compatibility @@ -435,11 +435,13 @@ if (!defined('Adminer\DRIVER')) { * @return mixed Db or string for error */ function connect($credentials) { + global $drivers; $connection = new Db; if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) { - $connection->set_charset(charset($connection)); // available in MySQLi since PHP 5.0.5 + $connection->set_charset(charset($connection)); $connection->query("SET sql_quote_show_create = 1, autocommit = 1"); $connection->maria = preg_match('~MariaDB~', $connection->server_info); + $drivers["server"] = ($connection->maria ? "MariaDB" : "MySQL"); return $connection; } $return = $connection->error; diff --git a/changes.txt b/changes.txt index a6bf14c2..c8eea2db 100644 --- a/changes.txt +++ b/changes.txt @@ -2,6 +2,7 @@ Adminer dev: Align numbers right (bug #912) Remember export setting at SQL command SQL textarea: Open help on Ctrl+click +MariaDB: Display MariaDB instead of MySQL CSS: Dark mode syntax highlighting Designs named adminer-dark.css use dark basic style Plugins: Add method syntaxHighlighting()