From 10cf3d2c7db5a9c01f5fd55c2f227ffd35f0fd6b Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Tue, 29 Jan 2008 13:46:05 +0000 Subject: [PATCH] [config] new parameter $cfg['Servers'][$i]['CountTables'] = true; set to false for speed improvements with many databases --- ChangeLog | 1 + libraries/List_Database.class.php | 10 ++++++++-- libraries/config.default.php | 7 +++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3ad32c99e..67bf10aec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA + [lang] Finnish update, thanks to Jouni Kahkonen + [config] new parameter $cfg['CheckConfigurationPermissions'] + [config] new parameter $cfg['Servers'][$i]['ShowDatabasesCommand'] ++ [config] new parameter $cfg['Servers'][$i]['CountTables'] + rfe #1775288 [transformation] proper display if IP-address stored as INT + rfe #1758177 [core] Add the Geometry DataTypes + rfe #1741101, patch #1798184 UUID default for CHAR(36) PRIMARY KEY, diff --git a/libraries/List_Database.class.php b/libraries/List_Database.class.php index 4d703c4d6..ab3e9fa32 100644 --- a/libraries/List_Database.class.php +++ b/libraries/List_Database.class.php @@ -322,8 +322,11 @@ require_once './libraries/List.class.php'; 'disp_name_cut' => $disp_name_cut, 'disp_name' => $disp_name, 'comment' => $db_tooltip, - 'num_tables' => PMA_getTableCount($db), ); + + if ($GLOBALS['cfg']['Server']['CountTables']) { + $dbgroups[$group][$db]['num_tables'] = PMA_getTableCount($db); + } } // end foreach ($GLOBALS['PMA_List_Database']->items as $db) return $dbgroups; } @@ -379,7 +382,10 @@ require_once './libraries/List.class.php'; } else { $return .= htmlspecialchars($db['disp_name']); } - $return .= ' (' . $db['num_tables'] . ')'; + + if (! empty($db['num_tables'])) { + $return .= ' (' . $db['num_tables'] . ')'; + } $return .= '' . "\n"; } if (count($dbs) > 1) { diff --git a/libraries/config.default.php b/libraries/config.default.php index 5a3aeae80..dfa7e3dc6 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -354,6 +354,13 @@ $cfg['Servers'][$i]['AllowDeny']['rules'] = array(); */ $cfg['Servers'][$i]['ShowDatabasesCommand'] = 'SHOW DATABASES'; +/** + * Whether to count tables when showing database list + * + * @global array $cfg['Servers'][$i]['CountTables'] + */ +$cfg['Servers'][$i]['CountTables'] = true; + /** * Default server (0 = no default server) *