}
function connect() {
- global $adminer;
+ $adminer = adminer();
$connection = new Min_DB;
list($server, $username, $password) = $adminer->credentials();
if (!preg_match('~^(https?://)?[-a-z\d.]+(:\d+)?$~', $server)) {
}
function get_databases($flush) {
- global $connection;
+ $connection = connection();
$result = get_rows('SHOW DATABASES');
$return = array();
}
function logged_user() {
- global $adminer;
+ $adminer = adminer();
$credentials = $adminer->credentials();
return $credentials[1];
}
}
function table_status($name = "", $fast = false) {
- global $connection;
+ $connection = connection();
$return = array();
$tables = get_rows("SELECT name, engine FROM system.tables WHERE database = " . q($connection->_db));
foreach ($tables as $table) {
}
function error() {
- global $connection;
+ $connection = connection();
return h($connection->error);
}
function query($path, array $content = null, $method = 'GET') {
// Support for global search through all tables
if ($path != "" && $path[0] == "S" && preg_match('/SELECT 1 FROM ([^ ]+) WHERE (.+) LIMIT ([0-9]+)/', $path, $matches)) {
- global $driver;
+ $driver = get_driver();
$where = explode(" AND ", $matches[2]);
function query($path, $content = array(), $method = 'GET') {
// Support for global search through all tables
if ($path != "" && $path[0] == "S" && preg_match('/SELECT 1 FROM ([^ ]+) WHERE (.+) LIMIT ([0-9]+)/', $path, $matches)) {
- global $driver;
+ $driver = get_driver();
$where = explode(" AND ", $matches[2]);
}
function connect() {
- global $adminer;
+ $adminer = adminer();
$connection = new Min_DB;
$credentials = $adminer->credentials();
if ($connection->connect($credentials[0], $credentials[1], $credentials[2])) {
}
function logged_user() {
- global $adminer;
+ $adminer = adminer();
$credentials = $adminer->credentials();
return $credentials[1];
}
function tables_list() {
- global $connection;
+ $connection = connection();
$query = 'SELECT RDB$RELATION_NAME FROM rdb$relations WHERE rdb$system_flag = 0';
$result = ibase_query($connection->_link, $query);
$return = array();
}
function table_status($name = "", $fast = false) {
- global $connection;
+ $connection = connection();
$return = array();
$data = tables_list();
foreach ($data as $index => $val) {
}
function fields($table) {
- global $connection;
+ $connection = connection();
$return = array();
$query = 'SELECT r.RDB$FIELD_NAME AS field_name,
r.RDB$DESCRIPTION AS field_description,
}
function error() {
- global $connection;
+ $connection = connection();
return h($connection->error);
}
public $primary = "itemName()";
function _chunkRequest($ids, $action, $params, $expand = array()) {
- global $connection;
+ $connection = connection();
foreach (array_chunk($ids, 25) as $chunk) {
$params2 = $params;
foreach ($chunk as $i => $id) {
}
function select($table, $select, $where, $group, $order = array(), $limit = 1, $page = 0, $print = false) {
- global $connection;
+ $connection = connection();
$connection->next = $_GET["next"];
$return = parent::select($table, $select, $where, $group, $order, $limit, $page, $print);
$connection->next = 0;
function connect() {
- global $adminer;
+ $adminer = adminer();
list($host, , $password) = $adminer->credentials();
if (!preg_match('~^(https?://)?[-a-z\d.]+(:\d+)?$~', $host)) {
return lang('Invalid server.');
}
function logged_user() {
- global $adminer;
+ $adminer = adminer();
$credentials = $adminer->credentials();
return $credentials[1];
}
}
function tables_list() {
- global $connection;
+ $connection = connection();
$return = array();
foreach (sdb_request_all('ListDomains', 'DomainName') as $table) {
$return[(string) $table] = 'table';
}
function error() {
- global $connection;
+ $connection = connection();
return h($connection->error);
}
}
function sdb_request($action, $params = array()) {
- global $adminer, $connection;
+ $adminer = adminer();
+ $connection = connection();
list($host, $params['AWSAccessKeyId'], $secret) = $adminer->credentials();
$params['Action'] = $action;
$params['Timestamp'] = gmdate('Y-m-d\TH:i:s+00:00');