summaryrefslogtreecommitdiffstats
path: root/old/admin/mysql_info.php
diff options
context:
space:
mode:
Diffstat (limited to 'old/admin/mysql_info.php')
-rw-r--r--old/admin/mysql_info.php131
1 files changed, 0 insertions, 131 deletions
diff --git a/old/admin/mysql_info.php b/old/admin/mysql_info.php
deleted file mode 100644
index 7993cc0..0000000
--- a/old/admin/mysql_info.php
+++ /dev/null
@@ -1,131 +0,0 @@
-<?php
-/******************************
- * EQdkp
- * Copyright 2002-2003
- * Licensed under the GNU GPL. See COPYING for full terms.
- * ------------------
- * mysql_info.php
- * Began: Sat April 5 2003
- *
- * $Id: mysql_info.php 46 2007-06-19 07:29:11Z tsigo $
- *
- ******************************/
-
-define('EQDKP_INC', true);
-define('IN_ADMIN', true);
-$eqdkp_root_path = './../';
-include_once($eqdkp_root_path . 'common.php');
-
-class MySQL_Info extends EQdkp_Admin
-{
- var $mysql_version = '';
- var $table_size = 0;
- var $index_size = 0;
- var $num_tables = 0;
-
- function mysql_info()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID;
-
- parent::eqdkp_admin();
-
- $this->assoc_buttons(array(
- 'form' => array(
- 'name' => '',
- 'process' => 'display_form',
- 'check' => 'a_'))
- );
-
- $result = $db->query('SELECT VERSION() AS mysql_version');
- if ( $row = $db->fetch_record($result) )
- {
- $this->mysql_version = $row['mysql_version'];
- }
- }
-
- // ---------------------------------------------------------
- // Display form
- // ---------------------------------------------------------
- function display_form()
- {
- global $db, $eqdkp, $user, $tpl, $pm;
- global $SID, $dbname, $table_prefix;
-
- if ( preg_match('/^(3\.23|4\.)/', $this->mysql_version) )
- {
- $db_name = ( preg_match('/^(3\.23\.[6-9])|(3\.23\.[1-9][1-9])|(4\.)/', $this->mysql_version) ) ? "`$dbname`" : $dbname;
-
- // Get table status
- $sql = 'SHOW TABLE STATUS
- FROM ' . $db_name;
- $result = $db->query($sql);
-
- $dbsize = 0;
- while ( $row = $db->fetch_record($result) )
- {
- if ( $row['Type'] != 'MRG_MyISAM' )
- {
- if ( $table_prefix != '' )
- {
- // Current row is an EQdkp table, get info for it
- if ( strstr($row['Name'], $table_prefix) )
- {
- $tpl->assign_block_vars('table_row', array(
- 'ROW_CLASS' => $eqdkp->switch_row_class(),
- 'TABLE_NAME' => $row['Name'],
- 'ROWS' => number_format($row['Rows'], ','),
- 'TABLE_SIZE' => $this->db_size($row['Data_length']),
- 'INDEX_SIZE' => $this->db_size($row['Index_length']))
- );
-
- $this->num_tables++;
- $this->table_size += $row['Data_length'];
- $this->index_size += $row['Index_length'];
- } // name match
- } // table_prefix != ''
- } // type != MRG_MyISAM
- } // while
-
- $tpl->assign_vars(array(
- 'NUM_TABLES' => sprintf($user->lang['num_tables'], $this->num_tables),
- 'TOTAL_TABLE_SIZE' => $this->db_size($this->table_size),
- 'TOTAL_INDEX_SIZE' => $this->db_size($this->index_size),
- 'TOTAL_SIZE' => $this->db_size($this->table_size + $this->index_size),
-
- 'L_EQDKP_TABLES' => $user->lang['eqdkp_tables'],
- 'L_TABLE_NAME' => $user->lang['table_name'],
- 'L_ROWS' => $user->lang['rows'],
- 'L_TABLE_SIZE' => $user->lang['table_size'],
- 'L_INDEX_SIZE' => $user->lang['index_size'],
- 'L_TOTALS' => $user->lang['totals'])
- );
-
- $eqdkp->set_vars(array(
- 'page_title' => 'MySQL Info',
- 'template_file' => 'admin/mysql_info.html',
- 'display' => true)
- );
- } // version match
- }
-
- function db_size($size)
- {
- if ( $size >= 1048576 )
- {
- return sprintf('%.2f MB', ($size / 1048576));
- }
- elseif ( $size >= 1024 )
- {
- return sprintf('%.2f KB', ($size / 1024));
- }
- else
- {
- return sprintf('%.2f B', $size);
- }
- }
-}
-
-$info = new MySQL_Info;
-$info->process();
-?> \ No newline at end of file