From b7508e237b6f9f4df6e0db4ca425d75639375e08 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Mon, 20 May 2013 13:14:58 -0400 Subject: [PATCH 1/5] Dead code --- libraries/List_Database.class.php | 54 ------------------------- test/classes/PMA_List_Database_test.php | 19 --------- 2 files changed, 73 deletions(-) diff --git a/libraries/List_Database.class.php b/libraries/List_Database.class.php index 39b121985b..f8241221d6 100644 --- a/libraries/List_Database.class.php +++ b/libraries/List_Database.class.php @@ -316,60 +316,6 @@ class PMA_List_Database extends PMA_List return array_slice($this->getArrayCopy(), $offset, $count); } - /** - * returns html code for list with dbs - * - * @return string html code list - */ - public function getHtmlListGrouped($selected = '', $offset = 0, $count = 0) - { - if (true === $selected) { - $selected = $this->getDefault(); - } - - $return = ''; - - return $return; - } - /** * returns html code for select form element with dbs * diff --git a/test/classes/PMA_List_Database_test.php b/test/classes/PMA_List_Database_test.php index fa224c616c..536c2550f4 100644 --- a/test/classes/PMA_List_Database_test.php +++ b/test/classes/PMA_List_Database_test.php @@ -129,24 +129,5 @@ class PMA_List_Database_test extends PHPUnit_Framework_TestCase ); } - /** - * Test for getHtmlListGrouped - * - * @return void - */ - public function testGetHtmlListGrouped() - { - $GLOBALS['cfg']['ShowTooltip'] = true; - $GLOBALS['cfgRelation']['commwork'] = true; - $GLOBALS['server'] = 1; - $GLOBALS['cfg']['NavigationTreeEnableGrouping'] = true; - $GLOBALS['cfg']['NavigationTreeDbSeparator'] = array('|',','); - - $this->assertEquals( - $this->object->getHtmlListGrouped(true, 5, 5), - '' - ); - } } ?> From 19d1efd90bb50e9d19602ae52d2ebe982e7df56a Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Mon, 20 May 2013 13:17:49 -0400 Subject: [PATCH 2/5] Dead code --- libraries/List_Database.class.php | 53 ------------------------------- 1 file changed, 53 deletions(-) diff --git a/libraries/List_Database.class.php b/libraries/List_Database.class.php index f8241221d6..71c32ee00c 100644 --- a/libraries/List_Database.class.php +++ b/libraries/List_Database.class.php @@ -316,59 +316,6 @@ class PMA_List_Database extends PMA_List return array_slice($this->getArrayCopy(), $offset, $count); } - /** - * returns html code for select form element with dbs - * - * @todo IE can not handle different text directions in select boxes so, - * as mostly names will be in english, we set the whole selectbox to LTR - * and EN - * - * @return string html code select - */ - public function getHtmlSelectGrouped($selected = '', $offset = 0, $count = 0) - { - if (true === $selected) { - $selected = $this->getDefault(); - } - - $return = ''; - - return $return; - } - /** * this is just a backup, if all is fine this can be deleted later * From b5dd9e2d040e6b767aeeebd9ae2b5b998db34e32 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Mon, 20 May 2013 13:19:12 -0400 Subject: [PATCH 3/5] Dead code --- libraries/List_Database.class.php | 74 ------------------------- test/classes/PMA_List_Database_test.php | 19 ------- 2 files changed, 93 deletions(-) diff --git a/libraries/List_Database.class.php b/libraries/List_Database.class.php index 71c32ee00c..1abcca55fb 100644 --- a/libraries/List_Database.class.php +++ b/libraries/List_Database.class.php @@ -229,80 +229,6 @@ class PMA_List_Database extends PMA_List return $this->getEmpty(); } - /** - * returns array with dbs grouped with extended infos - * - * @param integer $offset - * @param integer $count - * - * @return array db list - */ - public function getGroupedDetails($offset, $count) - { - $dbgroups = array(); - - if ($GLOBALS['cfg']['ShowTooltip'] - && $GLOBALS['cfgRelation']['commwork'] - ) { - $db_tooltips = PMA_getDbComments(); - } - - if (!$GLOBALS['cfg']['NavigationTreeEnableGrouping']) { - $separators = array(); - } elseif (is_array($GLOBALS['cfg']['NavigationTreeDbSeparator'])) { - $separators = $GLOBALS['cfg']['NavigationTreeDbSeparator']; - } elseif (!empty($GLOBALS['cfg']['NavigationTreeDbSeparator'])) { - $separators = array($GLOBALS['cfg']['NavigationTreeDbSeparator']); - } else { - $separators = array(); - } - - foreach ($this->getLimitedItems($offset, $count) as $db) { - // Get comments from PMA comments table - $db_tooltip = ''; - - if (isset($db_tooltips[$db])) { - $db_tooltip = $db_tooltips[$db]; - } - - $pos = false; - - foreach ($separators as $separator) { - // use strpos instead of strrpos; it seems more common to - // have the db name, the separator, then the rest which - // might contain a separator - // like dbname_the_rest - $pos = strpos($db, $separator, 1); - - if ($pos !== false) { - break; - } - } - - if ($pos !== false) { - $group = substr($db, 0, $pos); - $disp_name_cut = substr($db, $pos); - } else { - $group = $db; - $disp_name_cut = $db; - } - - $disp_name = $db; - - $dbgroups[$group][$db] = array( - 'name' => $db, - 'disp_name_cut' => $disp_name_cut, - 'disp_name' => $disp_name, - 'comment' => $db_tooltip, - ); - - if ($GLOBALS['cfg']['Server']['CountTables']) { - $dbgroups[$group][$db]['num_tables'] = PMA_getTableCount($db); - } - } // end foreach ($GLOBALS['PMA_List_Database']->items as $db) - return $dbgroups; - } - /** * returns a part of the items * diff --git a/test/classes/PMA_List_Database_test.php b/test/classes/PMA_List_Database_test.php index 536c2550f4..778eaf0342 100644 --- a/test/classes/PMA_List_Database_test.php +++ b/test/classes/PMA_List_Database_test.php @@ -110,24 +110,5 @@ class PMA_List_Database_test extends PHPUnit_Framework_TestCase ); } - /** - * Test for getGroupedDetails - * - * @return void - */ - public function testGetGroupedDetails() - { - $GLOBALS['cfg']['ShowTooltip'] = true; - $GLOBALS['cfgRelation']['commwork'] = true; - $GLOBALS['server'] = 1; - $GLOBALS['cfg']['NavigationTreeEnableGrouping'] = true; - $GLOBALS['cfg']['NavigationTreeDbSeparator'] = array('|',','); - - $this->assertEquals( - $this->object->getGroupedDetails(10, 100), - array() - ); - } - } ?> From 5a251b8b07ff444f42f83823a90fced86d492d0e Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Mon, 20 May 2013 13:21:53 -0400 Subject: [PATCH 4/5] Dead code --- libraries/List_Database.class.php | 13 ------------- test/classes/PMA_List_Database_test.php | 12 ------------ 2 files changed, 25 deletions(-) diff --git a/libraries/List_Database.class.php b/libraries/List_Database.class.php index 1abcca55fb..f2902e1ae3 100644 --- a/libraries/List_Database.class.php +++ b/libraries/List_Database.class.php @@ -229,19 +229,6 @@ class PMA_List_Database extends PMA_List return $this->getEmpty(); } - /** - * returns a part of the items - * - * @param integer $offset - * @param integer $count - * - * @return array some items - */ - public function getLimitedItems($offset, $count) - { - return array_slice($this->getArrayCopy(), $offset, $count); - } - /** * this is just a backup, if all is fine this can be deleted later * diff --git a/test/classes/PMA_List_Database_test.php b/test/classes/PMA_List_Database_test.php index 778eaf0342..76f11b57ab 100644 --- a/test/classes/PMA_List_Database_test.php +++ b/test/classes/PMA_List_Database_test.php @@ -55,18 +55,6 @@ class PMA_List_Database_test extends PHPUnit_Framework_TestCase $this->assertEquals(true, $arr->exists('single_db')); } - public function testLimitedItems() - { - $arr = new PMA_List_Database; - $this->assertEquals(array('single_db'), $arr->getLimitedItems(0, 1)); - } - - public function testLimitedItems_empty() - { - $arr = new PMA_List_Database; - $this->assertEquals(array(), $arr->getLimitedItems(1, 1)); - } - public function testHtmlOptions() { $arr = new PMA_List_Database; From 6d890c362698ca74b9aa5c928923c5f8aa22267b Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Mon, 20 May 2013 13:28:44 -0400 Subject: [PATCH 5/5] bug #3917 CountTables directive is deprecated --- ChangeLog | 1 + doc/config.rst | 8 -------- libraries/config.default.php | 7 ------- libraries/config/messages.inc.php | 2 -- libraries/config/setup.forms.php | 3 +-- 5 files changed, 2 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1569934107..79549d051a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,7 @@ phpMyAdmin - ChangeLog - bug Missing CREATE DATABASE statement when exporting at database level - bug #3924 Show warning when CSV file does not contain data for all columns - bug #3947 Missing Sql Query after modify structure +- bug #3917 CountTables directive is deprecated 4.0.1.0 (2013-05-14) - bug #3879 Import broken for CSV using LOAD DATA diff --git a/doc/config.rst b/doc/config.rst index 7087ecf243..4e872ffc34 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -915,14 +915,6 @@ Server connection settings * ``'SELECT SCHEMA_NAME FROM information_schema.SCHEMATA'`` * ``false`` -.. config:option:: $cfg['Servers'][$i]['CountTables'] - - :type: boolean - :default: false - - Whether to count the number of tables for each database when preparing - the list of databases for the navigation panel. - .. config:option:: $cfg['Servers'][$i]['SignonScript'] :type: string diff --git a/libraries/config.default.php b/libraries/config.default.php index 2d4c89baf0..ed306b6be3 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -469,13 +469,6 @@ $cfg['Servers'][$i]['DisableIS'] = true; */ $cfg['Servers'][$i]['ShowDatabasesCommand'] = 'SHOW DATABASES'; -/** - * Whether to count tables when showing database list - * - * @global array $cfg['Servers'][$i]['CountTables'] - */ -$cfg['Servers'][$i]['CountTables'] = false; - /** * Whether the tracking mechanism creates * versions for tables and views automatically. diff --git a/libraries/config/messages.inc.php b/libraries/config/messages.inc.php index acb0674bc0..9222c64f22 100644 --- a/libraries/config/messages.inc.php +++ b/libraries/config/messages.inc.php @@ -386,8 +386,6 @@ $strConfigServers_controluser_desc = __('A special MySQL user configured with li $strConfigServers_controluser_name = __('Control user'); $strConfigServers_controlhost_desc = __('An alternate host to hold the configuration storage; leave blank to use the already defined host'); $strConfigServers_controlhost_name = __('Control host'); -$strConfigServers_CountTables_desc = __('Count tables when showing database list'); -$strConfigServers_CountTables_name = __('Count tables'); $strConfigServers_designer_coords_desc = __('Leave blank for no Designer support, suggested: [kbd]pma__designer_coords[/kbd]'); $strConfigServers_designer_coords_name = __('Designer table'); $strConfigServers_DisableIS_desc = __('More information on [a@https://sourceforge.net/p/phpmyadmin/bugs/2606/]PMA bug tracker[/a] and [a@http://bugs.mysql.com/19588]MySQL Bugs[/a]'); diff --git a/libraries/config/setup.forms.php b/libraries/config/setup.forms.php index 5f42688808..1dd665b213 100644 --- a/libraries/config/setup.forms.php +++ b/libraries/config/setup.forms.php @@ -60,8 +60,7 @@ $forms['Servers']['Server_config'] = array('Servers' => array(1 => array( 'DisableIS', 'AllowDeny/order', 'AllowDeny/rules', - 'ShowDatabasesCommand', - 'CountTables'))); + 'ShowDatabasesCommand'))); $forms['Servers']['Server_pmadb'] = array('Servers' => array(1 => array( 'pmadb' => 'phpmyadmin', 'controlhost',