1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-06 14:46:36 +02:00

Use adminer() instead of $adminer

This commit is contained in:
Jakub Vrana
2025-03-29 20:56:19 +01:00
parent 87f149ce1d
commit 845445baad
29 changed files with 184 additions and 218 deletions

View File

@@ -63,19 +63,18 @@ abstract class SqlDriver {
}
/** Select data from table
* @param list<string> $select result of $adminer->selectColumnsProcess()[0]
* @param list<string> $where result of $adminer->selectSearchProcess()
* @param list<string> $group result of $adminer->selectColumnsProcess()[1]
* @param list<string> $order result of $adminer->selectOrderProcess()
* @param int|numeric-string $limit result of $adminer->selectLimitProcess()
* @param list<string> $select result of adminer()->selectColumnsProcess()[0]
* @param list<string> $where result of adminer()->selectSearchProcess()
* @param list<string> $group result of adminer()->selectColumnsProcess()[1]
* @param list<string> $order result of adminer()->selectOrderProcess()
* @param int|numeric-string $limit result of adminer()->selectLimitProcess()
* @param int $page index of page starting at zero
* @param bool $print whether to print the query
* @return Result|false
*/
function select(string $table, array $select, array $where, array $group, array $order = array(), $limit = 1, ?int $page = 0, bool $print = false) {
global $adminer;
$is_group = (count($group) < count($select));
$query = $adminer->selectQueryBuild($select, $where, $group, $order, $limit, $page);
$query = adminer()->selectQueryBuild($select, $where, $group, $order, $limit, $page);
if (!$query) {
$query = "SELECT" . limit(
($_GET["page"] != "last" && $limit != "" && $group && $is_group && JUSH == "sql" ? "SQL_CALC_FOUND_ROWS " : "") . implode(", ", $select) . "\nFROM " . table($table),
@@ -88,7 +87,7 @@ abstract class SqlDriver {
$start = microtime(true);
$return = $this->conn->query($query);
if ($print) {
echo $adminer->selectQuery($query, $start, !$return);
echo adminer()->selectQuery($query, $start, !$return);
}
return $return;
}