From b5dd9e2d040e6b767aeeebd9ae2b5b998db34e32 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Mon, 20 May 2013 13:19:12 -0400 Subject: [PATCH] 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() - ); - } - } ?>