webRoot; $themeRoot = $webRoot . "theme/"; $type = !isset($_GET['type']) ? 'check' : $_GET['type']; if($type != 'check' and $type != 'repair') die(); if(!isset($_SESSION['checkFileName'])) { $checkFileName = dirname(__FILE__) . DS . uniqid('repair_') . '.txt'; $_SESSION['checkFileName'] = $checkFileName; } $checkFileName = $_SESSION['checkFileName']; $status = ''; if(!file_exists($checkFileName) or (time() - filemtime($checkFileName)) > 60 * 10) $status = 'createFile'; $lang = new stdclass(); $lang->misc = new stdclass(); include '../module/misc/lang/zh-cn.php'; if($status == 'createFile') { $lang->user = new stdclass(); $lang->projectCommon = ''; include '../module/user/lang/zh-cn.php'; } else { $dsn = "mysql:host={$config->db->host}; port={$config->db->port}; dbname={$config->db->name}"; $dbh = new PDO($dsn, $config->db->user, $config->db->password, array(PDO::ATTR_PERSISTENT => $config->db->persistant)); $dbh->exec("SET NAMES {$config->db->encoding}"); $dbh->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $tables = array(); $stmt = $dbh->query("show full tables"); while($table = $stmt->fetch(PDO::FETCH_ASSOC)) { $tableName = $table["Tables_in_{$config->db->name}"]; $tableType = strtolower($table['Table_type']); if($tableType == 'base table') { $tableStatus = $dbh->query("$type table $tableName")->fetch(); $tables[$tableName] = strtolower($tableStatus->Msg_text); } } $status = 'check'; } ?>
' type='text/css' media='screen' />| misc->tableName?> | misc->tableStatus?> | |
|---|---|---|
| '> | myisamchk -r -f {$tableName}.MYI进行修复。"?> | |
| ' class='btn btn-primary'>misc->needRepair?> | ||