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


PHP PMA_getHtmlForShowStats函数代码示例

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


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

示例1: PMA_getHtmlForNotNullEngineViewTable

/**
 * Get HTML for ENGINE value not null or view tables that are not empty tables
 *
 * @param boolean $table_is_view  whether table is view
 * @param array   $current_table  current table
 * @param string  $collation      collation
 * @param boolean $is_show_stats  whether atats show or not
 * @param string  $tbl_url_query  table url query
 * @param string  $formatted_size formatted size
 * @param string  $unit           unit
 * @param string  $overhead       overhead
 * @param string  $create_time    create time
 * @param string  $update_time    update time
 * @param string  $check_time     check time
 *
 * @return string $html_output
 */
function PMA_getHtmlForNotNullEngineViewTable($table_is_view, $current_table, $collation, $is_show_stats, $tbl_url_query, $formatted_size, $unit, $overhead, $create_time, $update_time, $check_time)
{
    $html_output = '';
    $row_count_pre = '';
    $show_superscript = '';
    if ($table_is_view) {
        // Drizzle views use FunctionEngine, and the only place where they are
        // available are I_S and D_D schemas, where we do exact counting
        if ($current_table['TABLE_ROWS'] >= $GLOBALS['cfg']['MaxExactCountViews'] && $current_table['ENGINE'] != 'FunctionEngine') {
            $row_count_pre = '~';
            $sum_row_count_pre = '~';
            $show_superscript = PMA_Util::showHint(PMA_sanitize(sprintf(__('This view has at least this number of rows. Please refer to %sdocumentation%s.'), '[doc@cfg_MaxExactCountViews]', '[/doc]')));
        }
    } elseif ($current_table['ENGINE'] == 'InnoDB' && !$current_table['COUNTED']) {
        // InnoDB table: we did not get an accurate row count
        $row_count_pre = '~';
        $sum_row_count_pre = '~';
        $show_superscript = '';
    }
    $html_output .= '<td class="value tbl_rows">' . $row_count_pre . PMA_Util::formatNumber($current_table['TABLE_ROWS'], 0) . $show_superscript . '</td>';
    if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
        $html_output .= '<td class="nowrap">' . ($table_is_view ? __('View') : $current_table['ENGINE']) . '</td>';
        if (strlen($collation)) {
            $html_output .= '<td class="nowrap">' . $collation . '</td>';
        }
    }
    if ($is_show_stats) {
        $html_output .= PMA_getHtmlForShowStats($tbl_url_query, $formatted_size, $unit, $overhead);
    }
    $html_output .= PMA_getHtmlForStructureTimes($create_time, $update_time, $check_time);
    return $html_output;
}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:49,代码来源:structure.lib.php

示例2: PMA_getHtmlForNotNullEngineViewTable

/**
 * Get HTML for ENGINE value not null or view tables that are not empty tables
 *
 * @param boolean $table_is_view  whether table is view
 * @param array   $current_table  current table
 * @param string  $collation      collation
 * @param boolean $is_show_stats  whether stats show or not
 * @param string  $tbl_url_query  table url query
 * @param string  $formatted_size formatted size
 * @param string  $unit           unit
 * @param string  $overhead       overhead
 * @param string  $create_time    create time
 * @param string  $update_time    update time
 * @param string  $check_time     check time
 *
 * @return string $html_output
 */
function PMA_getHtmlForNotNullEngineViewTable($table_is_view, $current_table, $collation, $is_show_stats, $tbl_url_query, $formatted_size, $unit, $overhead, $create_time, $update_time, $check_time)
{
    $html_output = '';
    $row_count_pre = '';
    $show_superscript = '';
    if ($table_is_view) {
        // Drizzle views use FunctionEngine, and the only place where they are
        // available are I_S and D_D schemas, where we do exact counting
        if ($current_table['TABLE_ROWS'] >= $GLOBALS['cfg']['MaxExactCountViews'] && $current_table['ENGINE'] != 'FunctionEngine') {
            $row_count_pre = '~';
            $show_superscript = PMA_Util::showHint(PMA_sanitize(sprintf(__('This view has at least this number of rows. Please refer to %sdocumentation%s.'), '[doc@cfg_MaxExactCountViews]', '[/doc]')));
        }
    } elseif ($current_table['ENGINE'] == 'InnoDB' && !$current_table['COUNTED']) {
        // InnoDB table: we did not get an accurate row count
        $row_count_pre = '~';
        $show_superscript = '';
    }
    // Set a flag if there are approximate row counts on page.
    if (!empty($row_count_pre)) {
        $approx_rows = true;
    } else {
        // this happens for information_schema, performance_schema,
        // and in case there is no InnoDB table on this page
        $approx_rows = false;
    }
    // Get the row count.
    $row_count = $row_count_pre . PMA_Util::formatNumber($current_table['TABLE_ROWS'], 0);
    // URL parameters to fetch the real row count.
    $real_count_url = array('ajax_request' => true, 'db' => $GLOBALS['db'], 'table' => $current_table['TABLE_NAME'], 'real_row_count' => 'true');
    // Content to be appended into 'tbl_rows' cell.
    // If row count is approximate, display it as an anchor to get real count.
    $cell_text = !empty($row_count_pre) ? '<a href="db_structure.php' . PMA_URL_getCommon($real_count_url) . '" class="ajax real_row_count">' . $row_count . '</a>' : $row_count;
    $html_output .= '<td class="value tbl_rows" data-table="' . htmlspecialchars($current_table['TABLE_NAME']) . '">' . $cell_text . $show_superscript . '</td>';
    if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)) {
        $html_output .= '<td class="nowrap">' . (!empty($current_table['ENGINE']) ? $current_table['ENGINE'] : ($table_is_view ? __('View') : '')) . '</td>';
        if (mb_strlen($collation)) {
            $html_output .= '<td class="nowrap">' . $collation . '</td>';
        }
    }
    if ($is_show_stats) {
        $html_output .= PMA_getHtmlForShowStats($tbl_url_query, $formatted_size, $unit, $overhead);
    }
    $html_output .= PMA_getHtmlForStructureTimes($create_time, $update_time, $check_time);
    return array($html_output, $approx_rows);
}
开发者ID:tecshuttle,项目名称:51qsk,代码行数:62,代码来源:structure.lib.php


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