mirror of
https://github.com/vrana/adminer.git
synced 2025-08-17 20:01:25 +02:00
MariaDB: Display MariaDB instead of MySQL
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Adminer;
|
namespace Adminer;
|
||||||
|
|
||||||
$drivers = array("server" => "MySQL") + $drivers;
|
$drivers = array("server" => "MySQL / MariaDB") + $drivers;
|
||||||
|
|
||||||
if (!defined('Adminer\DRIVER')) {
|
if (!defined('Adminer\DRIVER')) {
|
||||||
define('Adminer\DRIVER', "server"); // server - backwards compatibility
|
define('Adminer\DRIVER', "server"); // server - backwards compatibility
|
||||||
@@ -435,11 +435,13 @@ if (!defined('Adminer\DRIVER')) {
|
|||||||
* @return mixed Db or string for error
|
* @return mixed Db or string for error
|
||||||
*/
|
*/
|
||||||
function connect($credentials) {
|
function connect($credentials) {
|
||||||
|
global $drivers;
|
||||||
$connection = new Db;
|
$connection = new Db;
|
||||||
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
|
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->query("SET sql_quote_show_create = 1, autocommit = 1");
|
||||||
$connection->maria = preg_match('~MariaDB~', $connection->server_info);
|
$connection->maria = preg_match('~MariaDB~', $connection->server_info);
|
||||||
|
$drivers["server"] = ($connection->maria ? "MariaDB" : "MySQL");
|
||||||
return $connection;
|
return $connection;
|
||||||
}
|
}
|
||||||
$return = $connection->error;
|
$return = $connection->error;
|
||||||
|
@@ -2,6 +2,7 @@ Adminer dev:
|
|||||||
Align numbers right (bug #912)
|
Align numbers right (bug #912)
|
||||||
Remember export setting at SQL command
|
Remember export setting at SQL command
|
||||||
SQL textarea: Open help on Ctrl+click
|
SQL textarea: Open help on Ctrl+click
|
||||||
|
MariaDB: Display MariaDB instead of MySQL
|
||||||
CSS: Dark mode syntax highlighting
|
CSS: Dark mode syntax highlighting
|
||||||
Designs named adminer-dark.css use dark basic style
|
Designs named adminer-dark.css use dark basic style
|
||||||
Plugins: Add method syntaxHighlighting()
|
Plugins: Add method syntaxHighlighting()
|
||||||
|
Reference in New Issue
Block a user