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

Plugins: Use namespace for driver functions

This commit is contained in:
Jakub Vrana
2025-03-05 15:42:48 +01:00
parent 137ac2396b
commit 0bf8861dd1
6 changed files with 8 additions and 8 deletions

View File

@@ -18,7 +18,7 @@ class AdminerDatabaseHide {
function databases($flush = true) {
$return = array();
foreach (get_databases($flush) as $db) {
foreach (Adminer\get_databases($flush) as $db) {
if (!in_array(strtolower($db), $this->disabled)) {
$return[] = $db;
}

View File

@@ -69,7 +69,7 @@ SELECT @adminer_alter;
function dumpTable($table, $style, $is_view = 0) {
if ($_POST["format"] == "sql_alter") {
$create = create_sql($table, $_POST["auto_increment"], $style);
$create = Adminer\create_sql($table, $_POST["auto_increment"], $style);
if ($is_view) {
echo substr_replace($create, " OR REPLACE", 6, 0) . ";\n\n";
} else {
@@ -140,7 +140,7 @@ CREATE PROCEDURE adminer_alter (INOUT alter_command text) BEGIN
UNTIL done END REPEAT;
CLOSE columns;
IF @alter_table != '' OR add_columns != '' THEN
SET alter_command = CONCAT(alter_command, 'ALTER TABLE " . table($table) . "', SUBSTR(CONCAT(add_columns, @alter_table), 2), ';\\n');
SET alter_command = CONCAT(alter_command, 'ALTER TABLE " . Adminer\table($table) . "', SUBSTR(CONCAT(add_columns, @alter_table), 2), ';\\n');
END IF;
END;;
DELIMITER ;

View File

@@ -30,7 +30,7 @@ class AdminerEditForeign {
if (preg_match('~binary~', $field["type"])) {
$column = "HEX($column)";
}
$options = array("" => "") + Adminer\get_vals("SELECT $column FROM " . table($target) . " ORDER BY 1" . ($this->_limit ? " LIMIT " . ($this->_limit + 1) : ""));
$options = array("" => "") + Adminer\get_vals("SELECT $column FROM " . Adminer\table($target) . " ORDER BY 1" . ($this->_limit ? " LIMIT " . ($this->_limit + 1) : ""));
if ($this->_limit && count($options) - 1 > $this->_limit) {
return;
}

View File

@@ -17,7 +17,7 @@ class AdminerEnumTypes {
// read types and "cache" it
if (is_null($this->_types)) {
$types = types();
$types = Adminer\types();
$this->_types = array();
foreach ($types as $type) {

View File

@@ -25,7 +25,7 @@ class AdminerSlugify {
if ($slugify === null) {
$slugify = array();
$prev = null;
foreach (fields($table) as $name => $val) {
foreach (Adminer\fields($table) as $name => $val) {
if ($prev && preg_match('~(^|_)slug(_|$)~', $name)) {
$slugify[$prev] = $name;
}

View File

@@ -15,7 +15,7 @@ class AdminerTableStructure {
function tableStructurePrint($fields) {
echo "<div class='scrollable'>\n";
echo "<table class='nowrap odds'>\n";
echo "<thead><tr><th>" . Adminer\lang('Column') . "<th>" . Adminer\lang('Type') . "<th>" . Adminer\lang('Collation') . "<th>" . Adminer\lang('Nullable') . "<th>" . Adminer\lang('Default') . (support("comment") ? "<th>" . Adminer\lang('Comment') : "") . "</thead>\n";
echo "<thead><tr><th>" . Adminer\lang('Column') . "<th>" . Adminer\lang('Type') . "<th>" . Adminer\lang('Collation') . "<th>" . Adminer\lang('Nullable') . "<th>" . Adminer\lang('Default') . (Adminer\support("comment") ? "<th>" . Adminer\lang('Comment') : "") . "</thead>\n";
foreach ($fields as $field) {
echo "<tr><th>" . Adminer\h($field["field"]) . ($field["primary"] ? " (PRIMARY)" : "");
echo "<td><span>" . Adminer\h($field["full_type"]) . "</span>";
@@ -23,7 +23,7 @@ class AdminerTableStructure {
echo "<td>" . ($field["collation"] ? " <i>" . Adminer\h($field["collation"]) . "</i>" : "");
echo "<td>" . ($field["null"] ? Adminer\lang('Yes') : Adminer\lang('No'));
echo "<td>" . Adminer\h($field["default"]);
echo (support("comment") ? "<td>" . Adminer\h($field["comment"]) : "");
echo (Adminer\support("comment") ? "<td>" . Adminer\h($field["comment"]) : "");
echo "\n";
}
echo "</table>\n";