From 477e745ee93f01349650d67642b5add5c48475b9 Mon Sep 17 00:00:00 2001 From: Katsuya Utada Date: Fri, 26 Nov 2010 06:40:48 +0100 Subject: [PATCH] Initial version --- plugins/other/mysql-table-size | 87 ++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100755 plugins/other/mysql-table-size diff --git a/plugins/other/mysql-table-size b/plugins/other/mysql-table-size new file mode 100755 index 00000000..94d186bd --- /dev/null +++ b/plugins/other/mysql-table-size @@ -0,0 +1,87 @@ +#!/usr/local/bin/php + 1 && $argv[1] == 'authconf') { + exit('yes'); +} + +foreach ($table_list as $_str_schema_table) { + $_ary_schema_table = explode('.',$_str_schema_table); + $schema = $_ary_schema_table[0]; + $table = $_ary_schema_table[1]; + $text .= << 1 && $argv[1] == 'config') { + $text = <<getTableSize($schema,$table); + $data_length = $row['data_length']; + echo "$table.value $data_length\n"; +} + +class MysqlTblSize { + + private $dbh; + + public function __construct($dbh) { + $this->dbh = $dbh; + } + + public function getTableSize($schema,$table) { + $bind = array($schema,$table); + $sql = <<dbh->prepare($sql); + $stmt->execute($bind); + return $row = $stmt->fetch(PDO::FETCH_ASSOC); + } + + public function getSchemaSize($schema) { + $bind = array($schema); + $sql = <<dbh->prepare($sql); + $stmt->execute($bind); + return $row = $stmt->fetch(PDO::FETCH_ASSOC); + } + + +}