mirror of
https://github.com/vrana/adminer.git
synced 2025-08-06 14:46:36 +02:00
Move engines() to Driver
This commit is contained in:
@@ -168,7 +168,7 @@ if (!$_POST) {
|
||||
}
|
||||
|
||||
$collations = collations();
|
||||
$engines = engines();
|
||||
$engines = $driver->engines();
|
||||
// case of engine may differ
|
||||
foreach ($engines as $engine) {
|
||||
if (!strcasecmp($engine, $row["Engine"])) {
|
||||
|
@@ -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()");
|
||||
}
|
||||
|
@@ -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
|
||||
*/
|
||||
|
@@ -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");
|
||||
}
|
||||
|
@@ -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");
|
||||
}
|
||||
|
@@ -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
|
||||
}
|
||||
|
@@ -253,6 +253,13 @@ abstract class SqlDriver {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Get supported engines
|
||||
* @return array
|
||||
*/
|
||||
function engines() {
|
||||
return array();
|
||||
}
|
||||
|
||||
/** Check whether table supports indexes
|
||||
* @param array result of table_status()
|
||||
* @return bool
|
||||
|
@@ -348,10 +348,6 @@ if (isset($_GET["elastic"])) {
|
||||
//
|
||||
}
|
||||
|
||||
function engines() {
|
||||
return array();
|
||||
}
|
||||
|
||||
function count_tables($databases) {
|
||||
$return = connection()->rootQuery('_aliases');
|
||||
return array("elastic" => ($return ? count($return) : 0));
|
||||
|
@@ -159,10 +159,6 @@ if (isset($_GET["firebird"])) {
|
||||
function db_collation($db, $collations) {
|
||||
}
|
||||
|
||||
function engines() {
|
||||
return array();
|
||||
}
|
||||
|
||||
function logged_user() {
|
||||
$adminer = adminer();
|
||||
$credentials = $adminer->credentials();
|
||||
|
@@ -252,10 +252,6 @@ if (isset($_GET["imap"])) {
|
||||
function fk_support($table_status) {
|
||||
}
|
||||
|
||||
function engines() {
|
||||
return array();
|
||||
}
|
||||
|
||||
function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) {
|
||||
return connection()->create($name);
|
||||
}
|
||||
|
@@ -500,10 +500,6 @@ if (isset($_GET["mongo"])) {
|
||||
function fk_support($table_status) {
|
||||
}
|
||||
|
||||
function engines() {
|
||||
return array();
|
||||
}
|
||||
|
||||
function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) {
|
||||
if ($table == "") {
|
||||
connection()->_db->createCollection($name);
|
||||
|
@@ -368,10 +368,6 @@ if (isset($_GET["simpledb"])) {
|
||||
function fk_support($table_status) {
|
||||
}
|
||||
|
||||
function engines() {
|
||||
return array();
|
||||
}
|
||||
|
||||
function alter_table($table, $name, $fields, $foreign, $comment, $engine, $collation, $auto_increment, $partitioning) {
|
||||
return ($table == "" && sdb_request('CreateDomain', array('DomainName' => $name)));
|
||||
}
|
||||
|
Reference in New Issue
Block a user