mirror of
https://github.com/vrana/adminer.git
synced 2025-08-08 23:57:29 +02:00
Simplify saving flavor
This commit is contained in:
@@ -452,7 +452,7 @@ if (!defined('Adminer\DRIVER')) {
|
|||||||
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
|
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
|
||||||
$connection->set_charset(charset($connection));
|
$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->flavor = (preg_match('~MariaDB~', $connection->server_info) ? 'maria' : '');
|
$connection->flavor = (preg_match('~MariaDB~', $connection->server_info) ? 'maria' : 'mysql');
|
||||||
$drivers[DRIVER] = ($connection->flavor == 'maria' ? "MariaDB" : "MySQL");
|
$drivers[DRIVER] = ($connection->flavor == 'maria' ? "MariaDB" : "MySQL");
|
||||||
return $connection;
|
return $connection;
|
||||||
}
|
}
|
||||||
|
@@ -187,7 +187,7 @@ if (isset($_GET["username"]) && is_string(get_password())) {
|
|||||||
if ($adminer->operators === null) {
|
if ($adminer->operators === null) {
|
||||||
$adminer->operators = $driver->operators;
|
$adminer->operators = $driver->operators;
|
||||||
}
|
}
|
||||||
if (Driver::$jush == 'sql' || $connection->flavor == 'cockroach') {
|
if ($connection->flavor) {
|
||||||
save_settings(array("vendor-" . DRIVER . "-" . SERVER => $drivers[DRIVER]));
|
save_settings(array("vendor-" . DRIVER . "-" . SERVER => $drivers[DRIVER]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user