diff options
author | Maurício Meneghini Fauth <mauriciofauth@gmail.com> | 2017-09-05 18:07:49 +0300 |
---|---|---|
committer | Maurício Meneghini Fauth <mauriciofauth@gmail.com> | 2017-09-05 18:07:49 +0300 |
commit | 54cfbc5eda57d52f213a1b1de5dac1798664ca74 (patch) | |
tree | 17dfeeb46a2996c7ccd3bed9c3d064ec6c2e8b3a /db_export.php | |
parent | 1e0e0daa4025e4bfc5d4f66a3e2159567af2f52d (diff) |
Refactor export functions to static methods
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
Diffstat (limited to 'db_export.php')
-rw-r--r-- | db_export.php | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/db_export.php b/db_export.php index 4b855204a9..2479f116cd 100644 --- a/db_export.php +++ b/db_export.php @@ -6,8 +6,11 @@ * @package PhpMyAdmin */ use PhpMyAdmin\Config\PageSettings; -use PhpMyAdmin\Display\Export; +use PhpMyAdmin\Display\Export as DisplayExport; +use PhpMyAdmin\Export; +use PhpMyAdmin\Message; use PhpMyAdmin\Response; +use PhpMyAdmin\Util; /** * Gets some core libraries @@ -15,7 +18,6 @@ use PhpMyAdmin\Response; require_once 'libraries/common.inc.php'; require_once 'libraries/config/user_preferences.forms.php'; require_once 'libraries/config/page_settings.forms.php'; -require_once 'libraries/export.lib.php'; PageSettings::showGroup('Export'); @@ -24,7 +26,7 @@ $header = $response->getHeader(); $scripts = $header->getScripts(); $scripts->addFile('export.js'); -// $sub_part is used in PhpMyAdmin\Util::getDbInfo() to see if we are coming from +// $sub_part is used in Util::getDbInfo() to see if we are coming from // db_export.php, in which case we don't obey $cfg['MaxTableList'] $sub_part = '_export'; require_once 'libraries/db_common.inc.php'; @@ -40,7 +42,7 @@ list( $tooltip_truename, $tooltip_aliasname, $pos -) = PhpMyAdmin\Util::getDbInfo($db, isset($sub_part) ? $sub_part : ''); +) = Util::getDbInfo($db, isset($sub_part) ? $sub_part : ''); /** * Displays the form @@ -50,7 +52,7 @@ $export_page_title = __('View dump (schema) of database'); // exit if no tables in db found if ($num_tables < 1) { $response->addHTML( - PhpMyAdmin\Message::error(__('No tables found in database.'))->getDisplay() + Message::error(__('No tables found in database.'))->getDisplay() ); exit; } // end if @@ -95,25 +97,25 @@ foreach (array('table_select', 'table_structure', 'table_data') as $one_key) { foreach ($tables as $each_table) { if (isset($_GET['table_select']) && is_array($_GET['table_select'])) { - $is_checked = PMA_getCheckedClause( + $is_checked = Export::getCheckedClause( $each_table['Name'], $_GET['table_select'] ); } elseif (isset($table_select)) { - $is_checked = PMA_getCheckedClause( + $is_checked = Export::getCheckedClause( $each_table['Name'], $table_select ); } else { $is_checked = ' checked="checked"'; } if (isset($_GET['table_structure']) && is_array($_GET['table_structure'])) { - $structure_checked = PMA_getCheckedClause( + $structure_checked = Export::getCheckedClause( $each_table['Name'], $_GET['table_structure'] ); } else { $structure_checked = $is_checked; } if (isset($_GET['table_data']) && is_array($_GET['table_data'])) { - $data_checked = PMA_getCheckedClause( + $data_checked = Export::getCheckedClause( $each_table['Name'], $_GET['table_data'] ); } else { @@ -151,7 +153,7 @@ if (! isset($multi_values)) { } $response = Response::getInstance(); $response->addHTML( - Export::getExportDisplay( + DisplayExport::getExportDisplay( 'database', $db, $table, $sql_query, $num_tables, $unlim_num_rows, $multi_values ) |