undefined variables

This commit is contained in:
Marc Delisle
2009-12-29 17:58:07 +00:00
parent e7d20c38bf
commit 0a217b9b62

View File

@@ -84,8 +84,8 @@ function PMA_exportHeader() {
global $table; global $table;
global $tables; global $tables;
$export_struct = $GLOBALS[$what . '_export_struc']; $export_struct = isset($GLOBALS[$what . '_export_struc']) ? true : false;
$export_data = $GLOBALS[$what . '_export_contents']; $export_data = isset($GLOBALS[$what . '_export_contents']) ? true : false;
if ($GLOBALS['output_charset_conversion']) { if ($GLOBALS['output_charset_conversion']) {
$charset = $GLOBALS['charset_of_file']; $charset = $GLOBALS['charset_of_file'];
@@ -139,11 +139,11 @@ function PMA_exportHeader() {
$type = 'table'; $type = 'table';
} }
if ($is_view && !$GLOBALS[$what . '_export_views']) { if ($is_view && ! isset($GLOBALS[$what . '_export_views'])) {
continue; continue;
} }
if (!$is_view && !$GLOBALS[$what . '_export_tables']) { if (! $is_view && ! isset($GLOBALS[$what . '_export_tables'])) {
continue; continue;
} }
@@ -155,7 +155,7 @@ function PMA_exportHeader() {
$head .= $tbl . ';' . $crlf; $head .= $tbl . ';' . $crlf;
$head .= ' </pma:' . $type . '>' . $crlf; $head .= ' </pma:' . $type . '>' . $crlf;
if ($GLOBALS[$what . '_export_triggers']) { if (isset($GLOBALS[$what . '_export_triggers']) && $GLOBALS[$what . '_export_triggers']) {
// Export triggers // Export triggers
$triggers = PMA_DBI_get_triggers($db, $table); $triggers = PMA_DBI_get_triggers($db, $table);
if ($triggers) { if ($triggers) {
@@ -178,7 +178,7 @@ function PMA_exportHeader() {
} }
} }
if ($GLOBALS[$what . '_export_functions']) { if (isset($GLOBALS[$what . '_export_functions']) && $GLOBALS[$what . '_export_functions']) {
// Export functions // Export functions
$functions = PMA_DBI_get_procedures_or_functions($db, 'FUNCTION'); $functions = PMA_DBI_get_procedures_or_functions($db, 'FUNCTION');
if ($functions) { if ($functions) {
@@ -201,7 +201,7 @@ function PMA_exportHeader() {
} }
} }
if ($GLOBALS[$what . '_export_procedures']) { if (isset($GLOBALS[$what . '_export_procedures']) && $GLOBALS[$what . '_export_procedures']) {
// Export procedures // Export procedures
$procedures = PMA_DBI_get_procedures_or_functions($db, 'PROCEDURE'); $procedures = PMA_DBI_get_procedures_or_functions($db, 'PROCEDURE');
if ($procedures) { if ($procedures) {
@@ -250,8 +250,7 @@ function PMA_exportDBHeader($db) {
global $crlf; global $crlf;
global $what; global $what;
if ($GLOBALS[$what . '_export_contents']) if (isset($GLOBALS[$what . '_export_contents']) && $GLOBALS[$what . '_export_contents']) {
{
$head = ' <!--' . $crlf $head = ' <!--' . $crlf
. ' - ' . $GLOBALS['strDatabase'] . ': ' . (isset($GLOBALS['use_backquotes']) ? PMA_backquote($db) : '\'' . $db . '\''). $crlf . ' - ' . $GLOBALS['strDatabase'] . ': ' . (isset($GLOBALS['use_backquotes']) ? PMA_backquote($db) : '\'' . $db . '\''). $crlf
. ' -->' . $crlf . ' -->' . $crlf
@@ -278,8 +277,7 @@ function PMA_exportDBFooter($db) {
global $crlf; global $crlf;
global $what; global $what;
if ($GLOBALS[$what . '_export_contents']) if (isset($GLOBALS[$what . '_export_contents']) && $GLOBALS[$what . '_export_contents']) {
{
return PMA_exportOutputHandler(' </database>' . $crlf); return PMA_exportOutputHandler(' </database>' . $crlf);
} }
else else
@@ -318,8 +316,7 @@ function PMA_exportDBCreate($db) {
function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) { function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
global $what; global $what;
if ($GLOBALS[$what . '_export_contents']) if (isset($GLOBALS[$what . '_export_contents']) && $GLOBALS[$what . '_export_contents']) {
{
$result = PMA_DBI_query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED); $result = PMA_DBI_query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
$columns_cnt = PMA_DBI_num_fields($result); $columns_cnt = PMA_DBI_num_fields($result);