mirror of
https://github.com/vrana/adminer.git
synced 2025-08-09 16:17:48 +02:00
Move connect() to Driver
This commit is contained in:
@@ -323,6 +323,13 @@ if (isset($_GET["mongo"])) {
|
||||
|
||||
public $primary = "_id";
|
||||
|
||||
static function connect(?string $server, string $username, string $password) {
|
||||
if ($server == "") {
|
||||
$server = "localhost:27017";
|
||||
}
|
||||
return parent::connect($server, $username, $password);
|
||||
}
|
||||
|
||||
function select(string $table, array $select, array $where, array $group, array $order = array(), $limit = 1, ?int $page = 0, bool $print = false) {
|
||||
$select = ($select == array("*")
|
||||
? array()
|
||||
@@ -430,15 +437,6 @@ if (isset($_GET["mongo"])) {
|
||||
return $credentials[1];
|
||||
}
|
||||
|
||||
function connect($credentials) {
|
||||
$connection = new Db;
|
||||
list($server, $username, $password) = $credentials;
|
||||
if ($server == "") {
|
||||
$server = "localhost:27017";
|
||||
}
|
||||
return ($connection->attach($server, $username, $password) ?: $connection);
|
||||
}
|
||||
|
||||
function alter_indexes($table, $alter) {
|
||||
foreach ($alter as $val) {
|
||||
list($type, $name, $set) = $val;
|
||||
|
Reference in New Issue
Block a user