当前位置: 首页>>代码示例>>PHP>>正文


PHP PMA_getTableCount函数代码示例

本文整理汇总了PHP中PMA_getTableCount函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_getTableCount函数的具体用法?PHP PMA_getTableCount怎么用?PHP PMA_getTableCount使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PMA_getTableCount函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testTableCount

 function testTableCount()
 {
     $GLOBALS['cfg']['Server']['extension'] = 'mysql';
     $GLOBALS['cfg']['Server']['host'] = 'localhost';
     $GLOBALS['cfg']['Server']['user'] = 'root';
     $this->assertEquals(5, PMA_getTableCount('meddb'));
     $this->assertTrue(true);
 }
开发者ID:bugyak,项目名称:phporadmin,代码行数:8,代码来源:PMA_getTableCount_test_dis.php

示例2: getGroupedDetails

    /**
     * returns array with dbs grouped with extended infos
     *
     * @uses    $GLOBALS['PMA_List_Database']
     * @uses    $GLOBALS['cfgRelation']['commwork']
     * @uses    $cfg['ShowTooltip']
     * @uses    $cfg['LeftFrameDBTree']
     * @uses    $cfg['LeftFrameDBSeparator']
     * @uses    $cfg['ShowTooltipAliasDB']
     * @uses    PMA_getTableCount()
     * @uses    PMA_getDbComment()
     * @uses    is_array()
     * @uses    implode()
     * @uses    strstr()
     * @uses    explode()
     * @param   integer $offset
     * @param   integer $count
     * @return  array   db list
     */
    public function getGroupedDetails($offset, $count)
    {
        $dbgroups   = array();
        $parts      = array();

        if ($GLOBALS['cfg']['ShowTooltip']
          && $GLOBALS['cfgRelation']['commwork']) {
            $db_tooltips = PMA_getDbComments();
        }

        if (!$GLOBALS['cfg']['LeftFrameDBTree']) {
            $separators = array();
        } elseif (is_array($GLOBALS['cfg']['LeftFrameDBSeparator'])) {
            $separators = $GLOBALS['cfg']['LeftFrameDBSeparator'];
        } elseif (!empty($GLOBALS['cfg']['LeftFrameDBSeparator'])) {
            $separators = array($GLOBALS['cfg']['LeftFrameDBSeparator']);
        } else {
            $separators = array();
        }

        foreach ($this->getLimitedItems($offset, $count) as $key => $db) {
            // garvin: 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);

                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;
            if ($db_tooltip && $GLOBALS['cfg']['ShowTooltipAliasDB']) {
                $disp_name      = $db_tooltip;
                $disp_name_cut  = $db_tooltip;
                $db_tooltip     = $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;
    }
开发者ID:blumenbach,项目名称:blumenbach-online.de,代码行数:89,代码来源:List_Database.class.php

示例3: htmlspecialchars

    <h5 style="margin-top: 0px; margin-bottom: 10px;"><a class="item"
        href="<?php 
    echo $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . $common_url_query;
    ?>
"
        title="<?php 
    echo htmlspecialchars($db_tooltip);
    ?>
" >
    <?php 
    if ($GLOBALS['text_dir'] === 'rtl') {
        echo ' <bdo dir="ltr">(' . PMA_getTableCount($GLOBALS['db']) . ')</bdo> ';
    }
    echo htmlspecialchars($disp_name);
    if ($GLOBALS['text_dir'] === 'ltr') {
        echo ' <bdo dir="ltr">(' . PMA_getTableCount($GLOBALS['db']) . ')</bdo> ';
    }
    echo '</a></h5>';
    $table_list = PMA_getTableList($GLOBALS['db']);
    if (count($table_list) > 0) {
        PMA_displayTableList($table_list, true, '', $GLOBALS['db']);
    } else {
        echo $GLOBALS['strNoTablesFound'];
    }
    unset($table_list);
} elseif ($GLOBALS['cfg']['LeftFrameLight']) {
    echo '<p>' . $GLOBALS['strSelectADb'] . '</p>' . "\n";
} else {
    $common_url_query = PMA_generate_common_url();
    PMA_displayDbList($GLOBALS['PMA_List_Database']->getGroupedDetails());
}
开发者ID:JakubMarden,项目名称:eshop,代码行数:31,代码来源:navigation.php

示例4: htmlspecialchars

    <p><a class="item"
        href="<?php 
    echo $GLOBALS['cfg']['DefaultTabDatabase'] . '?' . $common_url_query;
    ?>
"
        title="<?php 
    echo htmlspecialchars($db_tooltip);
    ?>
" >
    <?php 
    if ($GLOBALS['text_dir'] === 'rtl') {
        echo ' <bdo dir="ltr">(' . PMA_getTableCount($db) . ')</bdo> ';
    }
    echo htmlspecialchars($disp_name);
    if ($GLOBALS['text_dir'] === 'ltr') {
        echo ' <bdo dir="ltr">(' . PMA_getTableCount($db) . ')</bdo> ';
    }
    echo '</a></p>';
    $table_list = PMA_getTableList($db);
    if (count($table_list) > 0) {
        PMA_displayTableList($table_list, true, '', $db);
    } else {
        echo $strNoTablesFound;
    }
    unset($table_list);
} elseif ($GLOBALS['cfg']['LeftFrameLight']) {
    echo '<p>' . $GLOBALS['strSelectADb'] . '</p>' . "\n";
} else {
    $common_url_query = PMA_generate_common_url();
    PMA_displayDbList(PMA_getDbList());
}
开发者ID:hoogle,项目名称:ttt,代码行数:31,代码来源:left.php

示例5: array

$img_minus = PMA_Util::getImage('b_minus.png', '-', array('id' => 'el%dImg'));

$href_left = '<a onclick="if (toggle(\'%d\')) return false;"'
    .' href="navigation.php?%s" target="_self">';

$element_counter = 0;


if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
    $table_list = PMA_Util::getTableList(
        $GLOBALS['db'],
        null,
        $tpos,
        $cfg['MaxTableList']
    );
    $table_count = PMA_getTableCount($GLOBALS['db']);

    // show selected databasename as link to DefaultTabDatabase-page
    // with table count in ()
    $common_url_query = PMA_generate_common_url($GLOBALS['db']);

    $db_tooltip = '';

    if ($GLOBALS['cfg']['ShowTooltip']
        && $GLOBALS['cfgRelation']['commwork']
    ) {
        $_db_tooltip = PMA_getDbComment($GLOBALS['db']);
        if ($_db_tooltip) {
            $db_tooltip = $_db_tooltip;
        }
    }
开发者ID:nhodges,项目名称:phpmyadmin,代码行数:31,代码来源:navigation.php

示例6: PMA_getDbList

/**
 * returns array with dbs grouped with extended infos
 *
 * @uses    $GLOBALS['dblist'] from PMA_availableDatabases()
 * @uses    $GLOBALS['num_dbs'] from PMA_availableDatabases()
 * @uses    $GLOBALS['cfgRelation']['commwork']
 * @uses    $GLOBALS['cfg']['ShowTooltip']
 * @uses    $GLOBALS['cfg']['LeftFrameDBTree']
 * @uses    $GLOBALS['cfg']['LeftFrameDBSeparator']
 * @uses    $GLOBALS['cfg']['ShowTooltipAliasDB']
 * @uses    PMA_availableDatabases()
 * @uses    PMA_getTableCount()
 * @uses    PMA_getComments()
 * @uses    PMA_availableDatabases()
 * @uses    is_array()
 * @uses    implode()
 * @uses    strstr()
 * @uses    explode()
 * @return  array   db list
 */
function PMA_getDbList()
{
    if (empty($GLOBALS['dblist'])) {
        PMA_availableDatabases();
    }
    $dblist = $GLOBALS['dblist'];
    $dbgroups = array();
    $parts = array();
    foreach ($dblist as $key => $db) {
        // garvin: Get comments from PMA comments table
        $db_tooltip = '';
        if ($GLOBALS['cfg']['ShowTooltip'] && $GLOBALS['cfgRelation']['commwork']) {
            $_db_tooltip = PMA_getComments($db);
            if (is_array($_db_tooltip)) {
                $db_tooltip = implode(' ', $_db_tooltip);
            }
        }
        if ($GLOBALS['cfg']['LeftFrameDBTree'] && $GLOBALS['cfg']['LeftFrameDBSeparator'] && strstr($db, $GLOBALS['cfg']['LeftFrameDBSeparator'])) {
            // 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, $GLOBALS['cfg']['LeftFrameDBSeparator']);
            $group = substr($db, 0, $pos);
            $disp_name_cut = substr($db, $pos);
        } else {
            $group = $db;
            $disp_name_cut = $db;
        }
        $disp_name = $db;
        if ($db_tooltip && $GLOBALS['cfg']['ShowTooltipAliasDB']) {
            $disp_name = $db_tooltip;
            $disp_name_cut = $db_tooltip;
            $db_tooltip = $db;
        }
        $dbgroups[$group][$db] = array('name' => $db, 'disp_name_cut' => $disp_name_cut, 'disp_name' => $disp_name, 'comment' => $db_tooltip, 'num_tables' => PMA_getTableCount($db));
    }
    // end foreach ($dblist as $db)
    return $dbgroups;
}
开发者ID:a195474368,项目名称:ejiawang,代码行数:60,代码来源:common.lib.php

示例7: PMA_getTableList

    /**
     * This helps reducing the navi panel size; in the right panel,
     * user can find a navigator to page thru all tables.
     *
     * @todo instead of the 0 parameter, keep track of the
     *       offset in the list of tables ($_SESSION['userconf']['table_limit_offset'])
     *       and use PMA_listNavigator(); do not just check pos in REQUEST
     *       but add another hidden param to see if it's the pos of databases
     *       or the pos of tables. 
     */
    $table_list = PMA_getTableList($GLOBALS['db'], null, 0, $cfg['MaxTableList']);
    if (!empty($table_list)) {
        PMA_displayTableList($table_list, true, '', $GLOBALS['db']);
        // hint user that the table list is larger, until the todo is done
        if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && PMA_getTableCount($GLOBALS['db']) > $GLOBALS['cfg']['MaxTableList']) {
            echo '&nbsp; ( 1 .. ', $GLOBALS['cfg']['MaxTableList'], ' / ', PMA_getTableCount($GLOBALS['db']), ' )';
        }
    } else {
        echo $GLOBALS['strNoTablesFound'];
    }
    unset($table_list);
} elseif ($GLOBALS['cfg']['LeftFrameLight']) {
    echo '<p>' . $GLOBALS['strSelectADb'] . '</p>' . "\n";
} else {
    echo '<div id="databaseList">' . "\n";
    $_url_params = array('pos' => $pos);
    PMA_listNavigator($GLOBALS['PMA_List_Database']->count(), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
    echo '</div>' . "\n";
    $common_url_query = PMA_generate_common_url();
    PMA_displayDbList($GLOBALS['PMA_List_Database']->getGroupedDetails($_SESSION['userconf']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']), $_SESSION['userconf']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']);
}
开发者ID:findlakes,项目名称:XSS-Platform,代码行数:31,代码来源:navigation.php


注:本文中的PMA_getTableCount函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。