From 9c994c741dbfc6396ea7652edfaae4bed220f919 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Thu, 18 Jun 2015 15:30:48 +0530 Subject: [PATCH] Use instance variable db rather than the GLOBAL value Signed-off-by: Madhura Jayaratne --- .../schema/dia/Dia_Relation_Schema.class.php | 2 +- .../schema/eps/Eps_Relation_Schema.class.php | 4 ++-- .../schema/pdf/Pdf_Relation_Schema.class.php | 18 +++++++++--------- .../schema/svg/Svg_Relation_Schema.class.php | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/libraries/plugins/schema/dia/Dia_Relation_Schema.class.php b/libraries/plugins/schema/dia/Dia_Relation_Schema.class.php index fe2f0ab7ee..91e297395f 100644 --- a/libraries/plugins/schema/dia/Dia_Relation_Schema.class.php +++ b/libraries/plugins/schema/dia/Dia_Relation_Schema.class.php @@ -249,7 +249,7 @@ class PMA_Dia_Relation_Schema extends PMA_Export_Relation_Schema $seen_a_relation = false; foreach ($alltables as $one_table) { - $exist_rel = PMA_getForeigners($GLOBALS['db'], $one_table, '', 'both'); + $exist_rel = PMA_getForeigners($this->db, $one_table, '', 'both'); if (!$exist_rel) { continue; } diff --git a/libraries/plugins/schema/eps/Eps_Relation_Schema.class.php b/libraries/plugins/schema/eps/Eps_Relation_Schema.class.php index 93d3ef3fd5..9c1f891cc7 100644 --- a/libraries/plugins/schema/eps/Eps_Relation_Schema.class.php +++ b/libraries/plugins/schema/eps/Eps_Relation_Schema.class.php @@ -345,7 +345,7 @@ class PMA_Eps_Relation_Schema extends PMA_Export_Relation_Schema $this->diagram->setTitle( sprintf( __('Schema of the %s database - Page %s'), - $GLOBALS['db'], + $this->db, $this->pageNumber ) ); @@ -374,7 +374,7 @@ class PMA_Eps_Relation_Schema extends PMA_Export_Relation_Schema $seen_a_relation = false; foreach ($alltables as $one_table) { - $exist_rel = PMA_getForeigners($GLOBALS['db'], $one_table, '', 'both'); + $exist_rel = PMA_getForeigners($this->db, $one_table, '', 'both'); if (!$exist_rel) { continue; } diff --git a/libraries/plugins/schema/pdf/Pdf_Relation_Schema.class.php b/libraries/plugins/schema/pdf/Pdf_Relation_Schema.class.php index c4ade595f2..2426452338 100644 --- a/libraries/plugins/schema/pdf/Pdf_Relation_Schema.class.php +++ b/libraries/plugins/schema/pdf/Pdf_Relation_Schema.class.php @@ -480,7 +480,7 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema $this->diagram->SetTitle( sprintf( __('Schema of the %s database'), - $GLOBALS['db'] + $this->db ) ); $this->diagram->setCMargin(0); @@ -565,7 +565,7 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema // and finding its foreigns is OK (then we can support innodb) $seen_a_relation = false; foreach ($alltables as $one_table) { - $exist_rel = PMA_getForeigners($GLOBALS['db'], $one_table, '', 'both'); + $exist_rel = PMA_getForeigners($this->db, $one_table, '', 'both'); if (!$exist_rel) { continue; } @@ -895,7 +895,7 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema 'L', 0, $this->diagram->PMA_links['doc'][$table]['-'] ); // $this->diagram->Ln(1); - $fields = $GLOBALS['dbi']->getColumns($GLOBALS['db'], $table); + $fields = $GLOBALS['dbi']->getColumns($this->db, $table); foreach ($fields as $row) { $this->diagram->SetX(20); $field_name = $row['Field']; @@ -942,15 +942,15 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema $this->diagram->ln(); $cfgRelation = PMA_getRelationsParam(); - $comments = PMA_getComments($GLOBALS['db'], $table); + $comments = PMA_getComments($this->db, $table); if ($cfgRelation['mimework']) { - $mime_map = PMA_getMIME($GLOBALS['db'], $table, true); + $mime_map = PMA_getMIME($this->db, $table, true); } /** * Gets table information */ - $showtable = PMA_Table::sGetStatusInfo($GLOBALS['db'], $table); + $showtable = PMA_Table::sGetStatusInfo($this->db, $table); $show_comment = isset($showtable['Comment']) ? $showtable['Comment'] : ''; @@ -973,12 +973,12 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema /** * Gets fields properties */ - $columns = $GLOBALS['dbi']->getColumns($GLOBALS['db'], $table); + $columns = $GLOBALS['dbi']->getColumns($this->db, $table); // Check if we can use Relations if (!empty($cfgRelation['relation'])) { // Find which tables are related with the current one and write it in // an array - $res_rel = PMA_getForeigners($GLOBALS['db'], $table); + $res_rel = PMA_getForeigners($this->db, $table); } // end if /** @@ -1080,7 +1080,7 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema $linksTo = ''; if ($foreigner) { $linksTo = '-> '; - if ($foreigner['foreign_db'] != $GLOBALS['db']) { + if ($foreigner['foreign_db'] != $this->db) { $linksTo .= $foreigner['foreign_db'] . '.'; } $linksTo .= $foreigner['foreign_table'] diff --git a/libraries/plugins/schema/svg/Svg_Relation_Schema.class.php b/libraries/plugins/schema/svg/Svg_Relation_Schema.class.php index b449d7b130..c0ceb67ca7 100644 --- a/libraries/plugins/schema/svg/Svg_Relation_Schema.class.php +++ b/libraries/plugins/schema/svg/Svg_Relation_Schema.class.php @@ -318,7 +318,7 @@ class PMA_Svg_Relation_Schema extends PMA_Export_Relation_Schema $this->diagram->setTitle( sprintf( __('Schema of the %s database - Page %s'), - $GLOBALS['db'], + $this->db, $this->pageNumber ) ); @@ -347,7 +347,7 @@ class PMA_Svg_Relation_Schema extends PMA_Export_Relation_Schema } $seen_a_relation = false; foreach ($alltables as $one_table) { - $exist_rel = PMA_getForeigners($GLOBALS['db'], $one_table, '', 'both'); + $exist_rel = PMA_getForeigners($this->db, $one_table, '', 'both'); if (!$exist_rel) { continue; }