}
}
- if ($is_sql) {
- echo "-- " . gmdate("Y-m-d H:i:s e") . "\n";
- }
+ $adminer->dumpFooter();
exit;
}
return $ext;
}
+ /** Print text after export
+ * @return null prints data
+ */
+ function dumpFooter() {
+ if ($_POST["format"] == "sql") {
+ echo "-- " . gmdate("Y-m-d H:i:s e") . "\n";
+ }
+ }
+
/** Set the path of the file for webserver load
* @return string path of the sql dump file
*/
$query = implode(" UNION ALL ", $union);
}
$adminer->dumpData($TABLE, "table", $query);
+ $adminer->dumpFooter();
exit;
}
dump_headers("sql");
$adminer->dumpTable("", "");
$adminer->dumpData("", "table", $_POST["query"]);
+ $adminer->dumpFooter();
exit;
}
SQLite: Fix creating table in compiled version (bug #901, regression from 5.0.0)
Elastic: Do not pass null values on insert (PR #892)
Elastic: Fix displaying sparse rows (PR #893)
+Plugins: Add method dumpFooter()
Adminer 5.0.2 (released 2025-03-10):
PostgreSQL: Fix setting NULL and original value on enum (bug #884)
return $ext;
}
+ function dumpFooter() {
+ }
+
function importServerPath() {
}
}
}
- function _database() {
- echo "}\n";
- }
-
function dumpData($table, $style, $query) {
if ($_POST["format"] == "json") {
if ($this->database) {
} else {
$this->database = true;
echo "{\n";
- register_shutdown_function(array($this, '_database'));
}
$connection = Adminer\connection();
$result = $connection->query($query, 1);
return "json";
}
}
+
+ function dumpFooter() {
+ if ($_POST["format"] == "json" && $this->database) {
+ echo "}\n";
+ }
+ }
}
*/
class AdminerDumpPhp {
protected $output = array();
- protected $shutdown_callback = false;
function dumpFormat() {
return array('php' => 'PHP');
function dumpTable($table, $style, $is_view = 0) {
if ($_POST['format'] == 'php') {
$this->output[$table] = array();
- if (!$this->shutdown_callback) {
- $this->shutdown_callback = true;
- register_shutdown_function(array($this, '_export'));
- }
return true;
}
}
}
}
- function _export() {
- echo "<?php\n";
- var_export($this->output);
+ function dumpFooter() {
+ if ($_POST['format'] == 'php') {
+ echo "<?php\n";
+ var_export($this->output);
+ echo ";\n";
+ }
}
}
}
}
- function _database() {
- echo "</database>\n";
- }
-
function dumpData($table, $style, $query) {
if ($_POST["format"] == "xml") {
if (!$this->database) {
$this->database = true;
echo "<database name='" . Adminer\h(Adminer\DB) . "'>\n";
- register_shutdown_function(array($this, '_database'));
}
$connection = Adminer\connection();
$result = $connection->query($query, 1);
return "xml";
}
}
+
+ function dumpFooter() {
+ if ($_POST["format"] == "xml" && $this->database) {
+ echo "</database>\n";
+ }
+ }
}
return $this->applyPlugin(__FUNCTION__, $args);
}
+ function dumpFooter() {
+ $args = func_get_args();
+ return $this->applyPlugin(__FUNCTION__, $args);
+ }
+
function importServerPath() {
$args = func_get_args();
return $this->applyPlugin(__FUNCTION__, $args);