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(); + } + } }