From f14aef28665343bdfdd9d19bb7b1cacb2f937775 Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Thu, 24 Jan 2013 16:50:39 +0100 Subject: [PATCH 1/8] remove unused variables --- libraries/plugins/import/ImportCsv.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/plugins/import/ImportCsv.class.php b/libraries/plugins/import/ImportCsv.class.php index c50f671dca..7cfa292c11 100644 --- a/libraries/plugins/import/ImportCsv.class.php +++ b/libraries/plugins/import/ImportCsv.class.php @@ -245,7 +245,7 @@ class ImportCsv extends ImportPlugin /* Trim also `, if user already included backquoted fields */ $val = trim($val, " \t\r\n\0\x0B`"); $found = false; - foreach ($tmp_fields as $id => $field) { + foreach ($tmp_fields as $field) { if ($field['Field'] == $val) { $found = true; break; @@ -457,7 +457,7 @@ class ImportCsv extends ImportPlugin } if ($this->_getAnalyze()) { - foreach ($values as $ley => $val) { + foreach ($values as $val) { $tempRow[] = $val; ++$col_count; } @@ -629,4 +629,4 @@ class ImportCsv extends ImportPlugin { $this->_analyze = $analyze; } -} \ No newline at end of file +} From ef423e145c8d1736d06c2da58617143f26b780df Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Thu, 24 Jan 2013 17:00:38 +0100 Subject: [PATCH 2/8] remove unused variables : key is not used --- libraries/Partition.class.php | 2 +- libraries/Scripts.class.php | 2 +- libraries/TableSearch.class.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/Partition.class.php b/libraries/Partition.class.php index 243fd8649c..72137f81a3 100644 --- a/libraries/Partition.class.php +++ b/libraries/Partition.class.php @@ -63,7 +63,7 @@ class PMA_Partition } else { // see http://dev.mysql.com/doc/refman/5.6/en/partitioning.html $plugins = PMA_DBI_fetch_result("SHOW PLUGINS"); - foreach ($plugins as $key => $value) { + foreach ($plugins as $value) { if ($value['Name'] == 'partition') { $have_partitioning = true; break; diff --git a/libraries/Scripts.class.php b/libraries/Scripts.class.php index 58cfbe89ce..c0d64d8ab1 100644 --- a/libraries/Scripts.class.php +++ b/libraries/Scripts.class.php @@ -52,7 +52,7 @@ class PMA_Scripts { $dynamic_scripts = ""; $params = array(); - foreach ($files as $key => $value) { + foreach ($files as $value) { if (strpos($value['filename'], "?") === false) { $include = true; if ($value['conditional_ie'] !== false && PMA_USR_BROWSER_AGENT === 'IE') { diff --git a/libraries/TableSearch.class.php b/libraries/TableSearch.class.php index a29c460950..e5a400bbe5 100644 --- a/libraries/TableSearch.class.php +++ b/libraries/TableSearch.class.php @@ -127,7 +127,7 @@ class PMA_TableSearch // Get details about the geometry fucntions $geom_types = PMA_Util::getGISDatatypes(); - foreach ($columns as $key => $row) { + foreach ($columns as $row) { // set column name $this->_columnNames[] = $row['Field']; From cb9e34d42a36c98835454f9181eabf593889654e Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Thu, 24 Jan 2013 17:01:56 +0100 Subject: [PATCH 3/8] remove unused variables --- libraries/core.lib.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libraries/core.lib.php b/libraries/core.lib.php index c702387956..ccce887fa2 100644 --- a/libraries/core.lib.php +++ b/libraries/core.lib.php @@ -228,11 +228,6 @@ function PMA_fatalError( } } - $error_header = __('Error'); - - $lang = $GLOBALS['available_languages'][$GLOBALS['lang']][1]; - $dir = $GLOBALS['text_dir']; - // on fatal errors it cannot hurt to always delete the current session if ($delete_session && isset($GLOBALS['session_name']) From b306da69353a7e68c7bc755e298f2cce2789e787 Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Thu, 24 Jan 2013 17:06:35 +0100 Subject: [PATCH 4/8] remove unused variables --- libraries/database_interface.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index f4dcaf75cf..8ba37e1414 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -193,7 +193,7 @@ function PMA_DBI_try_query($query, $link = null, $options = 0, if ($cache_affected_rows) { $GLOBALS['cached_affected_rows'] = PMA_DBI_affected_rows( - $link, $get_from_cache = false + $link, false ); } @@ -2024,7 +2024,7 @@ function PMA_DBI_get_triggers($db, $table = '', $delimiter = '//') // Sort results by name $name = array(); - foreach ($result as $key => $value) { + foreach ($result as $value) { $name[] = $value['name']; } array_multisort($name, SORT_ASC, $result); From de34039b7092a55ab287e5652be06fb5f017bccb Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Thu, 24 Jan 2013 17:08:19 +0100 Subject: [PATCH 5/8] cleanup whitespace --- libraries/database_interface.lib.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index 8ba37e1414..b865badf5b 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -192,15 +192,12 @@ function PMA_DBI_try_query($query, $link = null, $options = 0, $result = PMA_DBI_real_query($query, $link, $options); if ($cache_affected_rows) { - $GLOBALS['cached_affected_rows'] = PMA_DBI_affected_rows( - $link, false - ); + $GLOBALS['cached_affected_rows'] = PMA_DBI_affected_rows($link, false); } if ($GLOBALS['cfg']['DBG']['sql']) { $time = microtime(true) - $time; PMA_DBI_DBG_query($query, $link, $result, $time); - } if ($result != false && PMA_Tracker::isActive() == true ) { PMA_Tracker::handleQuery($query); From 3dec7c23a5ddc9cfb315e5f2ce2d652467b9ff65 Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Thu, 24 Jan 2013 17:10:09 +0100 Subject: [PATCH 6/8] remove unused variable --- libraries/display_select_lang.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/display_select_lang.lib.php b/libraries/display_select_lang.lib.php index dacb7a5730..a6fef0816a 100644 --- a/libraries/display_select_lang.lib.php +++ b/libraries/display_select_lang.lib.php @@ -35,7 +35,7 @@ function PMA_languageCmp($a, $b) */ function PMA_getLanguageSelectorHtml($use_fieldset = false, $show_doc = true) { - global $cfg, $lang; + global $lang; $retval = ''; From f05801bdb82b22d2b933f323ebcd2449ebf05a4e Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Thu, 24 Jan 2013 17:15:06 +0100 Subject: [PATCH 7/8] wrap long line --- libraries/display_select_lang.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/display_select_lang.lib.php b/libraries/display_select_lang.lib.php index a6fef0816a..41a9098d2f 100644 --- a/libraries/display_select_lang.lib.php +++ b/libraries/display_select_lang.lib.php @@ -66,7 +66,8 @@ function PMA_getLanguageSelectorHtml($use_fieldset = false, $show_doc = true) . $language_title . ': '; } - $retval .= ''; uasort($GLOBALS['available_languages'], 'PMA_languageCmp'); foreach ($GLOBALS['available_languages'] as $id => $tmplang) { From ed94a77259fe575804fa08cc87dded7ec26d9149 Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Thu, 24 Jan 2013 17:30:42 +0100 Subject: [PATCH 8/8] remove unused variables --- libraries/file_listing.lib.php | 2 +- libraries/import.lib.php | 1 - libraries/insert_edit.lib.php | 4 ++-- libraries/js_escape.lib.php | 2 +- libraries/sqlparser.lib.php | 2 -- libraries/zip_extension.lib.php | 2 -- 6 files changed, 4 insertions(+), 9 deletions(-) diff --git a/libraries/file_listing.lib.php b/libraries/file_listing.lib.php index 70ee20a244..e5b680c2ca 100644 --- a/libraries/file_listing.lib.php +++ b/libraries/file_listing.lib.php @@ -59,7 +59,7 @@ function PMA_getFileSelectOptions($dir, $extensions = '', $active = '') return false; } $result = ''; - foreach ($list as $key => $val) { + foreach ($list as $val) { $result .= '