Esempio n. 1
0
 foreach (table_status('', true) as $name => $table_status) {
     $table = DB == "" || in_array($name, (array) $_POST["tables"]);
     $data = DB == "" || in_array($name, (array) $_POST["data"]);
     if ($table || $data) {
         if ($ext == "tar") {
             $tmp_file = new TmpFile();
             ob_start(array($tmp_file, 'write'), 100000.0);
         }
         $adminer->dumpTable($name, $table ? $_POST["table_style"] : "", is_view($table_status) ? 2 : 0);
         if (is_view($table_status)) {
             $views[] = $name;
         } elseif ($data) {
             $fields = fields($name);
             $adminer->dumpData($name, $_POST["data_style"], "SELECT *" . convert_fields($fields, $fields) . " FROM " . table($name));
         }
         if ($is_sql && $_POST["triggers"] && $table && ($triggers = trigger_sql($name, $_POST["table_style"]))) {
             echo "\nDELIMITER ;;\n{$triggers}\nDELIMITER ;\n";
         }
         if ($ext == "tar") {
             ob_end_flush();
             tar_file((DB != "" ? "" : "{$db}/") . "{$name}.csv", $tmp_file);
         } elseif ($is_sql) {
             echo "\n";
         }
     }
 }
 foreach ($views as $view) {
     $adminer->dumpTable($view, $_POST["table_style"], 1);
 }
 if ($ext == "tar") {
     echo pack("x512");
Esempio n. 2
0
 }
 if ($_POST["table_style"] || $_POST["data_style"]) {
     $views = array();
     foreach (table_status() as $table_status) {
         $table = DB == "" || in_array($table_status["Name"], (array) $_POST["tables"]);
         $data = DB == "" || in_array($table_status["Name"], (array) $_POST["data"]);
         if ($table || $data) {
             if (!is_view($table_status)) {
                 if ($ext == "tar") {
                     ob_start();
                 }
                 $adminer->dumpTable($table_status["Name"], $table ? $_POST["table_style"] : "");
                 if ($data) {
                     $adminer->dumpData($table_status["Name"], $_POST["data_style"], "SELECT * FROM " . table($table_status["Name"]));
                 }
                 if ($is_sql && $_POST["triggers"] && $table && ($triggers = trigger_sql($table_status["Name"], $_POST["table_style"]))) {
                     echo "\nDELIMITER ;;\n{$triggers}\nDELIMITER ;\n";
                 }
                 if ($ext == "tar") {
                     echo tar_file((DB != "" ? "" : "{$db}/") . "{$table_status['Name']}.csv", ob_get_clean());
                 } elseif ($is_sql) {
                     echo "\n";
                 }
             } elseif ($is_sql) {
                 $views[] = $table_status["Name"];
             }
         }
     }
     foreach ($views as $view) {
         $adminer->dumpTable($view, $_POST["table_style"], true);
     }