]> git.joonet.de Git - adminer.git/commitdiff
Plugins: Use namespace for driver functions
authorJakub Vrana <jakub@vrana.cz>
Wed, 5 Mar 2025 14:42:48 +0000 (15:42 +0100)
committerJakub Vrana <jakub@vrana.cz>
Wed, 5 Mar 2025 14:54:08 +0000 (15:54 +0100)
plugins/database-hide.php
plugins/dump-alter.php
plugins/edit-foreign.php
plugins/enum-types.php
plugins/slugify.php
plugins/table-structure.php

index 4c3883adc5ed57f0697a310526b1eaa574582727..3786be7d59b6037a8efedf308a6ebd0e68756cc1 100644 (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;
                        }
index 5c9f6b73ba58bd4790248103fc3fed6b4db958fe..8c8285219eb626fcde15da6a842b074cb9d94459 100644 (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 ;
index 57f9ad6da146433ada0ec10c146e72fb090389e9..2e4236f64d6b5bf3257d4bec175deaf337bba246 100644 (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;
                                        }
index dd36d6d10f8d81f7d66c4f67f2f256cc46194567..6a61261594a36bf0a6ceb8f6f07aacd4506ea646 100644 (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) {
index e9071ebc22482a08ba6405e69c72b4b8a442b4b8..6331db35202dd334907c833a1773de33e7dbb22a 100644 (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;
                                        }
index e75c3eb0ae46d8a432b3ff89d62da3fc1aafdbbc..fd0428ec9a2b352d8214f9fcf703e4a5592345ea 100644 (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";