1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-13 01:54:00 +02:00

Move engines() to Driver

This commit is contained in:
Jakub Vrana
2025-03-18 13:41:24 +01:00
parent b2f904c64f
commit a3d1ab34bb
12 changed files with 18 additions and 50 deletions

View File

@@ -309,10 +309,6 @@ if (isset($_GET["mssql"])) {
return get_val("SELECT collation_name FROM sys.databases WHERE name = " . q($db));
}
function engines() {
return array();
}
function logged_user() {
return get_val("SELECT SUSER_NAME()");
}

View File

@@ -410,6 +410,16 @@ if (!defined('Adminer\DRIVER')) {
}
return $c_style;
}
function engines() {
$return = array();
foreach (get_rows("SHOW ENGINES") as $row) {
if (preg_match("~YES|DEFAULT~", $row["Support"])) {
$return[] = $row["Engine"];
}
}
return $return;
}
}
@@ -508,19 +518,6 @@ if (!defined('Adminer\DRIVER')) {
return $return;
}
/** Get supported engines
* @return array
*/
function engines() {
$return = array();
foreach (get_rows("SHOW ENGINES") as $row) {
if (preg_match("~YES|DEFAULT~", $row["Support"])) {
$return[] = $row["Engine"];
}
}
return $return;
}
/** Get logged user
* @return string
*/

View File

@@ -247,10 +247,6 @@ ORDER BY 1"
return get_val("SELECT value FROM nls_database_parameters WHERE parameter = 'NLS_CHARACTERSET'"); //! respect $db
}
function engines() {
return array();
}
function logged_user() {
return get_val("SELECT USER FROM DUAL");
}

View File

@@ -366,10 +366,6 @@ ORDER BY datname");
return get_val("SELECT datcollate FROM pg_database WHERE datname = " . q($db));
}
function engines() {
return array();
}
function logged_user() {
return get_val("SELECT user");
}

View File

@@ -219,10 +219,6 @@ if (isset($_GET["sqlite"])) {
return get_val("PRAGMA encoding"); // there is no database list so $db == DB
}
function engines() {
return array();
}
function logged_user() {
return get_current_user(); // should return effective user
}