From 7b1ea5fa2cef0775e447f488cf71cbcadd8c2201 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 11 Mar 2025 18:20:11 +0100 Subject: [PATCH] AdminerDumpAlter: Use dumpFooter --- plugins/dump-alter.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/dump-alter.php b/plugins/dump-alter.php index bfc559eb..8c0d6884 100644 --- a/plugins/dump-alter.php +++ b/plugins/dump-alter.php @@ -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(); + } + } }