]> git.joonet.de Git - adminer.git/commitdiff
AdminerDumpAlter: Use dumpFooter
authorJakub Vrana <jakub@vrana.cz>
Tue, 11 Mar 2025 17:20:11 +0000 (18:20 +0100)
committerJakub Vrana <jakub@vrana.cz>
Tue, 11 Mar 2025 17:20:11 +0000 (18:20 +0100)
plugins/dump-alter.php

index bfc559eb6278000993680840d091f1decea46c9f..8c0d68849e700971115e3abd6c72ff03bf6c53df 100644 (file)
@@ -14,7 +14,7 @@ class AdminerDumpAlter {
                }
        }
 
-       function _database() {
+       private function database() {
                // drop old tables
                $query = "SELECT TABLE_NAME, ENGINE, TABLE_COLLATION, TABLE_COMMENT FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE()";
                echo "DELIMITER ;;
@@ -59,9 +59,8 @@ SELECT @adminer_alter;
                        if ($first) {
                                $first = false;
                                echo "SET @adminer_alter = '';\n\n";
-                               register_shutdown_function(array($this, '_database'));
                        } else {
-                               $this->_database();
+                               $this->database();
                        }
                        return true;
                }
@@ -159,4 +158,10 @@ DROP PROCEDURE adminer_alter;
                        return true;
                }
        }
+
+       function dumpFooter() {
+               if ($_POST["format"] == "sql_alter") {
+                       $this->database();
+               }
+       }
 }