Hi
On Tue, 19 Sep 2006 10:38:41 +0200 Sebastian Mendel lists@sebastianmendel.de wrote:
if (PMA_MYSQL_INT_VERSION < 40002 || !empty($GLOBALS['cfg']['Server']['hide_db'])) {
if the above comes true every DB is checked with 'USE dB' for access, Why?
Because the loop does two independent things:
- Verify that we can access the database for MySQL < 4.0.2 - Remove databases matching hide_db
Feel free to change it to separate loops to avoid confusion (and make the execution faster):
if (PMA_MYSQL_INT_VERSION < 40002) { foreach ($dbs_array as $key => $db) { if (!@PMA_DBI_select_db($db, $link)) { unset( $dbs_array[$key] ); } } // re-index values $dbs_array = array_values( $dbs_array ); } if (!empty($GLOBALS['cfg']['Server']['hide_db'])) { foreach ($dbs_array as $key => $db) { if (preg_match('/' . $GLOBALS['cfg']['Server']['hide_db'] . '/', $db)) { unset( $dbs_array[$key] ); } } // re-index values $dbs_array = array_values( $dbs_array ); }