mirror of
https://github.com/vrana/adminer.git
synced 2025-08-07 07:06:45 +02:00
@@ -13,12 +13,13 @@ function add_driver($id, $name) {
|
|||||||
$drivers[$id] = $name;
|
$drivers[$id] = $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get driver
|
/** Get driver name
|
||||||
* @return Driver
|
* @param string
|
||||||
|
* @return string
|
||||||
*/
|
*/
|
||||||
function get_driver() {
|
function get_driver($id) {
|
||||||
global $driver;
|
global $drivers;
|
||||||
return $driver;
|
return $drivers[$id];
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class SqlDriver {
|
abstract class SqlDriver {
|
||||||
|
@@ -20,6 +20,14 @@ function adminer() {
|
|||||||
return $adminer;
|
return $adminer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Get Driver object
|
||||||
|
* @return Driver
|
||||||
|
*/
|
||||||
|
function driver() {
|
||||||
|
global $driver;
|
||||||
|
return $driver;
|
||||||
|
}
|
||||||
|
|
||||||
/** Get Adminer version
|
/** Get Adminer version
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
@@ -61,7 +61,7 @@ if (isset($_GET["elastic"])) {
|
|||||||
function query($path, array $content = null, $method = 'GET') {
|
function query($path, array $content = null, $method = 'GET') {
|
||||||
// Support for global search through all tables
|
// Support for global search through all tables
|
||||||
if ($path != "" && $path[0] == "S" && preg_match('/SELECT 1 FROM ([^ ]+) WHERE (.+) LIMIT ([0-9]+)/', $path, $matches)) {
|
if ($path != "" && $path[0] == "S" && preg_match('/SELECT 1 FROM ([^ ]+) WHERE (.+) LIMIT ([0-9]+)/', $path, $matches)) {
|
||||||
$driver = get_driver();
|
$driver = driver();
|
||||||
|
|
||||||
$where = explode(" AND ", $matches[2]);
|
$where = explode(" AND ", $matches[2]);
|
||||||
|
|
||||||
|
@@ -166,7 +166,7 @@ if (isset($_GET["mongo"])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function fields($table) {
|
function fields($table) {
|
||||||
$driver = get_driver();
|
$driver = driver();
|
||||||
$fields = fields_from_edit();
|
$fields = fields_from_edit();
|
||||||
if (!$fields) {
|
if (!$fields) {
|
||||||
$result = $driver->select($table, array("*"), null, null, array(), 10);
|
$result = $driver->select($table, array("*"), null, null, array(), 10);
|
||||||
|
Reference in New Issue
Block a user