Example #1
0
 * @copyright Copyright (C) 2002 - 2010  MantisBT Team - mantisbt-dev@lists.sourceforge.net
 * @link http://www.mantisbt.org
 */
/**
 * MantisBT Core API's
 */
require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'core.php';
access_ensure_global_level(config_get_global('admin_site_threshold'));
# --------------------
function helper_table_row_count($p_table)
{
    $t_table = $p_table;
    $query = "SELECT COUNT(*) FROM {$t_table}";
    $result = db_query_bound($query);
    $t_users = db_result($result);
    return $t_users;
}
# --------------------
function print_table_stats($p_table_name)
{
    $t_count = helper_table_row_count($p_table_name);
    echo "{$p_table_name} = {$t_count} records<br />";
}
echo '<html><head><title>MantisBT Database Statistics</title></head><body>';
echo '<h1>MantisBT Database Statistics</h1>';
foreach (db_get_table_list() as $t_table) {
    if (db_table_exists($t_table)) {
        print_table_stats($t_table);
    }
}
echo '</body></html>';
Example #2
0
echo '<html><head><title>Mantis Database Statistics</title></head><body>';
echo '<h1>Mantis Database Statistics</h1>';
# echo '<table border="1" width="50%" cellpadding="3" cellspacing="0">';
print_table_stats(config_get('mantis_bug_file_table'));
print_table_stats(config_get('mantis_bug_history_table'));
print_table_stats(config_get('mantis_bug_monitor_table'));
print_table_stats(config_get('mantis_bug_relationship_table'));
print_table_stats(config_get('mantis_bug_table'));
print_table_stats(config_get('mantis_bug_text_table'));
print_table_stats(config_get('mantis_bugnote_table'));
print_table_stats(config_get('mantis_bugnote_text_table'));
print_table_stats(config_get('mantis_config_table'));
print_table_stats(config_get('mantis_custom_field_project_table'));
print_table_stats(config_get('mantis_custom_field_string_table'));
print_table_stats(config_get('mantis_custom_field_table'));
print_table_stats(config_get('mantis_filters_table'));
print_table_stats(config_get('mantis_news_table'));
print_table_stats(config_get('mantis_project_category_table'));
print_table_stats(config_get('mantis_project_file_table'));
print_table_stats(config_get('mantis_project_hierarchy_table'));
print_table_stats(config_get('mantis_project_table'));
print_table_stats(config_get('mantis_project_user_list_table'));
print_table_stats(config_get('mantis_project_version_table'));
print_table_stats(config_get('mantis_sponsorship_table'));
print_table_stats(config_get('mantis_tokens_table'));
print_table_stats(config_get('mantis_user_pref_table'));
print_table_stats(config_get('mantis_user_print_pref_table'));
print_table_stats(config_get('mantis_user_profile_table'));
print_table_stats(config_get('mantis_user_table'));
# echo '</table>';
echo '</body></html>';