]> git.joonet.de Git - adminer.git/commitdiff
IMAP: Avoid globals
authorJakub Vrana <jakub@vrana.cz>
Tue, 18 Mar 2025 12:00:40 +0000 (13:00 +0100)
committerJakub Vrana <jakub@vrana.cz>
Tue, 18 Mar 2025 12:00:40 +0000 (13:00 +0100)
plugins/drivers/imap.php

index 7300156bffe63485cc0735d85b2afb70452561ab..d61f37b83750847a526994290faf91901bfb7427 100644 (file)
@@ -205,18 +205,16 @@ if (isset($_GET["imap"])) {
        }
 
        function tables_list() {
-               global $connection;
-               return $connection->tables_list();
+               return connection()->tables_list();
        }
 
        function table_status($name = "", $fast = false) {
-               global $connection;
                if ($name != "") {
-                       return $connection->table_status($name, $fast);
+                       return connection()->table_status($name, $fast);
                }
                $return = array();
                foreach (tables_list() as $table => $type) {
-                       $return[$table] = $connection->table_status($table, $fast);
+                       $return[$table] = connection()->table_status($table, $fast);
                }
                return $return;
        }
@@ -226,8 +224,7 @@ if (isset($_GET["imap"])) {
        }
 
        function error() {
-               global $connection;
-               return h($connection->error);
+               return h(connection()->error);
        }
 
        function is_view($table_status) {