mirror of
https://github.com/vrana/adminer.git
synced 2026-06-20 13:20:54 +02:00
Plugins: Add method dumpFooter()
This commit is contained in:
@@ -19,10 +19,6 @@ class AdminerDumpJson {
|
||||
}
|
||||
}
|
||||
|
||||
function _database() {
|
||||
echo "}\n";
|
||||
}
|
||||
|
||||
function dumpData($table, $style, $query) {
|
||||
if ($_POST["format"] == "json") {
|
||||
if ($this->database) {
|
||||
@@ -30,7 +26,6 @@ class AdminerDumpJson {
|
||||
} else {
|
||||
$this->database = true;
|
||||
echo "{\n";
|
||||
register_shutdown_function(array($this, '_database'));
|
||||
}
|
||||
$connection = Adminer\connection();
|
||||
$result = $connection->query($query, 1);
|
||||
@@ -57,4 +52,10 @@ class AdminerDumpJson {
|
||||
return "json";
|
||||
}
|
||||
}
|
||||
|
||||
function dumpFooter() {
|
||||
if ($_POST["format"] == "json" && $this->database) {
|
||||
echo "}\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
class AdminerDumpPhp {
|
||||
protected $output = array();
|
||||
protected $shutdown_callback = false;
|
||||
|
||||
function dumpFormat() {
|
||||
return array('php' => 'PHP');
|
||||
@@ -23,10 +22,6 @@ class AdminerDumpPhp {
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -44,8 +39,11 @@ class AdminerDumpPhp {
|
||||
}
|
||||
}
|
||||
|
||||
function _export() {
|
||||
echo "<?php\n";
|
||||
var_export($this->output);
|
||||
function dumpFooter() {
|
||||
if ($_POST['format'] == 'php') {
|
||||
echo "<?php\n";
|
||||
var_export($this->output);
|
||||
echo ";\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,16 +19,11 @@ class AdminerDumpXml {
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -51,4 +46,10 @@ class AdminerDumpXml {
|
||||
return "xml";
|
||||
}
|
||||
}
|
||||
|
||||
function dumpFooter() {
|
||||
if ($_POST["format"] == "xml" && $this->database) {
|
||||
echo "</database>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -387,6 +387,11 @@ class AdminerPlugin extends Adminer\Adminer {
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user