[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/admin/ -> db_stats.php (source)

   1  <?php
   2  # MantisBT - A PHP based bugtracking system
   3  
   4  # MantisBT is free software: you can redistribute it and/or modify
   5  # it under the terms of the GNU General Public License as published by
   6  # the Free Software Foundation, either version 2 of the License, or
   7  # (at your option) any later version.
   8  #
   9  # MantisBT is distributed in the hope that it will be useful,
  10  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12  # GNU General Public License for more details.
  13  #
  14  # You should have received a copy of the GNU General Public License
  15  # along with MantisBT.  If not, see <http://www.gnu.org/licenses/>.
  16  
  17  /**
  18   * @package MantisBT
  19   * @copyright Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
  20   * @copyright Copyright (C) 2002 - 2011  MantisBT Team - mantisbt-dev@lists.sourceforge.net
  21   * @link http://www.mantisbt.org
  22   */
  23  /**
  24   * MantisBT Core API's
  25   */
  26  require_once( dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR . 'core.php' );
  27  
  28  access_ensure_global_level( config_get_global( 'admin_site_threshold' ) );
  29  
  30  # --------------------
  31  function helper_table_row_count( $p_table ) {
  32      $t_table = $p_table;
  33      $query = "SELECT COUNT(*) FROM $t_table";
  34      $result = db_query_bound( $query );
  35      $t_users = db_result( $result );
  36  
  37      return $t_users;
  38  }
  39  
  40  # --------------------
  41  function print_table_stats( $p_table_name ) {
  42      $t_count = helper_table_row_count( $p_table_name );
  43      echo "$p_table_name = $t_count records<br />";
  44  }
  45  
  46  echo '<html><head><title>MantisBT Database Statistics</title></head><body>';
  47  
  48  echo '<h1>MantisBT Database Statistics</h1>';
  49  
  50  foreach( db_get_table_list() as $t_table ) {
  51      if( db_table_exists( $t_table ) ) {
  52          print_table_stats( $t_table );
  53      }
  54  }
  55  
  56  echo '</body></html>';


Generated: Thu Jul 28 15:48:31 2011 Cross-referenced by PHPXref 0.7