LoginSignup
1
2

More than 5 years have passed since last update.

phpMyAdminのDBグループ表示を無効化する

Posted at

業務でphpMyAdminを使用していると、データベース名がアンダースコア起点でグループ化されて少々鬱陶しいので何とかしてみる。

まずは、フレーム左のナビゲーション部分を調べてみる。

./navigation.php(312-)
    echo '<div id="databaseList">' . "\n";    $_url_params = array('pos' => $pos);    PMA_listNavigator(count($GLOBALS['pma']->databases), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);    echo '</div>' . "\n";    $common_url_query = PMA_generate_common_url();    PMA_displayDbList($GLOBALS['pma']->databases->getGroupedDetails($_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']), $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']);

PMA_displayDbList()が表示しているっぽい。で、ここは何やってるかなと……

./navigation.php(334-)
function PMA_displayDbList($ext_dblist, $offset, $count){    global $element_counter, $img_minus, $img_plus, $href_left,        $db_start, $common_url_query;    // get table list, for all databases    // doing this in one step takes advantage of a single query with information_schema!    $tables_full = PMA_DBI_get_tables_full($GLOBALS['pma']->databases->getLimitedItems($offset, $count));    $url_dbgroup = '';    echo '<ul id="leftdatabaselist">';    $close_db_group = false;    foreach ($ext_dblist as $group => $db_group) {        if (count($GLOBALS['pma']->databases) > 1) {            if ($close_db_group) {                $url_dbgroup = '';```

$ext_dblistを追っかければ何かわかるかな
$ext_dblist 
<= $GLOBALS['pma']->databases->getGroupedDetails($_SESSION['tmp_user_values']['navi_limit_offset'];



``` php:./libraries/List_Database.class.php(256-)
            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;                }            }

ここで、グルーピングのためのセパレータをチェックしているので、この部分をまるごと消すなりコメントアウトすればOKっぽい。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2