Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurício Meneghini Fauth <mauriciofauth@gmail.com>2018-04-01 01:28:25 +0300
committerMaurício Meneghini Fauth <mauriciofauth@gmail.com>2018-04-01 01:28:25 +0300
commit2638eb920796bf85c15c9f0752855c6271180507 (patch)
tree579c6e4e411daa2ed087d18682a9db616c8e9659 /export.php
parentaade3546b278cb303a8c4f7ad46b64adb1b31524 (diff)
Refactor PhpMyAdmin\Export static methods
Replaces static methods with instance methods. Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
Diffstat (limited to 'export.php')
-rw-r--r--export.php46
1 files changed, 24 insertions, 22 deletions
diff --git a/export.php b/export.php
index 376bd020c2..e1255ae631 100644
--- a/export.php
+++ b/export.php
@@ -35,6 +35,8 @@ $header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('export_output.js');
+$export = new Export();
+
//check if it's the GET request to check export time out
if (isset($_GET['check_time_out'])) {
if (isset($_SESSION['pma_export_error'])) {
@@ -298,7 +300,7 @@ if ((!empty($parser->statements[0]))
$aliases = \PhpMyAdmin\SqlParser\Utils\Misc::getAliases($parser->statements[0], $db);
}
if (!empty($_REQUEST['aliases'])) {
- $aliases = Export::mergeAliases($aliases, $_REQUEST['aliases']);
+ $aliases = $export->mergeAliases($aliases, $_REQUEST['aliases']);
$_SESSION['tmpval']['aliases'] = $_REQUEST['aliases'];
}
@@ -309,7 +311,7 @@ Util::setTimeLimit();
if (! empty($cfg['MemoryLimit'])) {
ini_set('memory_limit', $cfg['MemoryLimit']);
}
-register_shutdown_function('PhpMyAdmin\Export::shutdown');
+register_shutdown_function([$export, 'shutdown']);
// Start with empty buffer
$dump_buffer = '';
$dump_buffer_len = 0;
@@ -339,7 +341,7 @@ $output_charset_conversion = $asfile
$GLOBALS['onfly_compression'] = $GLOBALS['cfg']['CompressOnFly']
&& $compression == 'gzip';
if ($GLOBALS['onfly_compression']) {
- $GLOBALS['memory_limit'] = Export::getMemoryLimit();
+ $GLOBALS['memory_limit'] = $export->getMemoryLimit();
}
// Generate filename and mime type if needed
@@ -347,7 +349,7 @@ if ($asfile) {
if (empty($remember_template)) {
$remember_template = '';
}
- list($filename, $mime_type) = Export::getFilenameAndMimetype(
+ list($filename, $mime_type) = $export->getFilenameAndMimetype(
$export_type, $remember_template, $export_plugin, $compression,
$filename_template
);
@@ -357,13 +359,13 @@ if ($asfile) {
// Open file on server if needed
if ($save_on_server) {
- list($save_filename, $message, $file_handle) = Export::openFile(
+ list($save_filename, $message, $file_handle) = $export->openFile(
$filename, $quick_export
);
// problem opening export file on server?
if (! empty($message)) {
- Export::showPage($db, $table, $export_type);
+ $export->showPage($db, $table, $export_type);
}
} else {
/**
@@ -391,7 +393,7 @@ if ($save_on_server) {
exit();
}
}
- list($html, $back_button, $refreshButton) = Export::getHtmlForDisplayedExportHeader(
+ list($html, $back_button, $refreshButton) = $export->getHtmlForDisplayedExportHeader(
$export_type, $db, $table
);
echo $html;
@@ -434,7 +436,7 @@ do {
if (! isset($db_select)) {
$db_select = '';
}
- Export::exportServer(
+ $export->exportServer(
$db_select, $whatStrucOrData, $export_plugin, $crlf, $err_url,
$export_type, $do_relation, $do_comments, $do_mime, $do_dates,
$aliases, $separate_files
@@ -451,19 +453,19 @@ do {
$table_data = $tables;
}
if (isset($lock_tables)) {
- Export::lockTables($db, $tables, "READ");
+ $export->lockTables($db, $tables, "READ");
try {
- Export::exportDatabase(
+ $export->exportDatabase(
$db, $tables, $whatStrucOrData, $table_structure,
$table_data, $export_plugin, $crlf, $err_url, $export_type,
$do_relation, $do_comments, $do_mime, $do_dates, $aliases,
$separate_files
);
} finally {
- Export::unlockTables();
+ $export->unlockTables();
}
} else {
- Export::exportDatabase(
+ $export->exportDatabase(
$db, $tables, $whatStrucOrData, $table_structure, $table_data,
$export_plugin, $crlf, $err_url, $export_type, $do_relation,
$do_comments, $do_mime, $do_dates, $aliases, $separate_files
@@ -483,18 +485,18 @@ do {
}
if (isset($lock_tables)) {
try {
- Export::lockTables($db, array($table), "READ");
- Export::exportTable(
+ $export->lockTables($db, array($table), "READ");
+ $export->exportTable(
$db, $table, $whatStrucOrData, $export_plugin, $crlf,
$err_url, $export_type, $do_relation, $do_comments,
$do_mime, $do_dates, $allrows, $limit_to, $limit_from,
$sql_query, $aliases
);
} finally {
- Export::unlockTables();
+ $export->unlockTables();
}
} else {
- Export::exportTable(
+ $export->exportTable(
$db, $table, $whatStrucOrData, $export_plugin, $crlf, $err_url,
$export_type, $do_relation, $do_comments, $do_mime, $do_dates,
$allrows, $limit_to, $limit_from, $sql_query, $aliases
@@ -509,14 +511,14 @@ do {
// End of fake loop
if ($save_on_server && ! empty($message)) {
- Export::showPage($db, $table, $export_type);
+ $export->showPage($db, $table, $export_type);
}
/**
* Send the dump as a file...
*/
if (empty($asfile)) {
- echo Export::getHtmlForDisplayedExportFooter($back_button, $refreshButton);
+ echo $export->getHtmlForDisplayedExportFooter($back_button, $refreshButton);
return;
} // end if
@@ -532,21 +534,21 @@ if ($output_charset_conversion) {
// Compression needed?
if ($compression) {
if (! empty($separate_files)) {
- $dump_buffer = Export::compress(
+ $dump_buffer = $export->compress(
$dump_buffer_objects, $compression, $filename
);
} else {
- $dump_buffer = Export::compress($dump_buffer, $compression, $filename);
+ $dump_buffer = $export->compress($dump_buffer, $compression, $filename);
}
}
/* If we saved on server, we have to close file now */
if ($save_on_server) {
- $message = Export::closeFile(
+ $message = $export->closeFile(
$file_handle, $dump_buffer, $save_filename
);
- Export::showPage($db, $table, $export_type);
+ $export->showPage($db, $table, $export_type);
} else {
echo $dump_buffer;
}