From 6d0f28b425dc9f975543301c4b194dd6fbdd494d Mon Sep 17 00:00:00 2001 From: Piotr Przybylski Date: Wed, 13 Jul 2011 23:40:58 +0200 Subject: [PATCH] Improve readability of XML export code --- libraries/export/xml.php | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/libraries/export/xml.php b/libraries/export/xml.php index 9bafb0998..9fd2a0202 100644 --- a/libraries/export/xml.php +++ b/libraries/export/xml.php @@ -82,13 +82,12 @@ function PMA_exportFooter() { function PMA_exportHeader() { global $crlf; global $cfg; - global $what; global $db; global $table; global $tables; - $export_struct = isset($GLOBALS[$what . '_export_struc']) ? true : false; - $export_data = isset($GLOBALS[$what . '_export_contents']) ? true : false; + $export_struct = isset($GLOBALS['xml_export_struc']) ? true : false; + $export_data = isset($GLOBALS['xml_export_contents']) ? true : false; if ($GLOBALS['output_charset_conversion']) { $charset = $GLOBALS['charset_of_file']; @@ -142,11 +141,11 @@ function PMA_exportHeader() { $type = 'table'; } - if ($is_view && ! isset($GLOBALS[$what . '_export_views'])) { + if ($is_view && ! isset($GLOBALS['xml_export_views'])) { continue; } - if (! $is_view && ! isset($GLOBALS[$what . '_export_tables'])) { + if (! $is_view && ! isset($GLOBALS['xml_export_tables'])) { continue; } @@ -158,7 +157,7 @@ function PMA_exportHeader() { $head .= $tbl . ';' . $crlf; $head .= ' ' . $crlf; - if (isset($GLOBALS[$what . '_export_triggers']) && $GLOBALS[$what . '_export_triggers']) { + if (isset($GLOBALS['xml_export_triggers']) && $GLOBALS['xml_export_triggers']) { // Export triggers $triggers = PMA_DBI_get_triggers($db, $table); if ($triggers) { @@ -181,7 +180,7 @@ function PMA_exportHeader() { } } - if (isset($GLOBALS[$what . '_export_functions']) && $GLOBALS[$what . '_export_functions']) { + if (isset($GLOBALS['xml_export_functions']) && $GLOBALS['xml_export_functions']) { // Export functions $functions = PMA_DBI_get_procedures_or_functions($db, 'FUNCTION'); if ($functions) { @@ -204,7 +203,7 @@ function PMA_exportHeader() { } } - if (isset($GLOBALS[$what . '_export_procedures']) && $GLOBALS[$what . '_export_procedures']) { + if (isset($GLOBALS['xml_export_procedures']) && $GLOBALS['xml_export_procedures']) { // Export procedures $procedures = PMA_DBI_get_procedures_or_functions($db, 'PROCEDURE'); if ($procedures) { @@ -251,9 +250,8 @@ function PMA_exportHeader() { */ function PMA_exportDBHeader($db) { global $crlf; - global $what; - if (isset($GLOBALS[$what . '_export_contents']) && $GLOBALS[$what . '_export_contents']) { + if (isset($GLOBALS['xml_export_contents']) && $GLOBALS['xml_export_contents']) { $head = ' ' . $crlf @@ -278,9 +276,8 @@ function PMA_exportDBHeader($db) { */ function PMA_exportDBFooter($db) { global $crlf; - global $what; - if (isset($GLOBALS[$what . '_export_contents']) && $GLOBALS[$what . '_export_contents']) { + if (isset($GLOBALS['xml_export_contents']) && $GLOBALS['xml_export_contents']) { return PMA_exportOutputHandler(' ' . $crlf); } else @@ -317,9 +314,8 @@ function PMA_exportDBCreate($db) { * @access public */ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) { - global $what; - - if (isset($GLOBALS[$what . '_export_contents']) && $GLOBALS[$what . '_export_contents']) { + + if (isset($GLOBALS['xml_export_contents']) && $GLOBALS['xml_export_contents']) { $result = PMA_DBI_query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED); $columns_cnt = PMA_DBI_num_fields($result);