connect_error) throw new E("无法连接至 MySQL 服务器,请检查你的配置:".$conn->connect_error, $conn->connect_errno, true); $conn->query("SET names 'utf8'"); return true; } public static function checkTableExist() { $tables = ['users', 'closets', 'players', 'textures', 'options']; foreach ($tables as $table_name) { // prefix will be added automatically if (!Schema::hasTable($table_name)) { return false; } } return true; } public static function checkCache() { $view_config = self::getViewConfig(); if (!is_dir($view_config['cache_path'])) { if (!mkdir($view_config['cache_path'])) throw new E('缓存文件夹创建失败,请确认目录权限是否正确', -1); } return true; } public static function checkDotEnvExist() { if (!file_exists(BASE_DIR."/.env")) exit('错误:.env 配置文件不存在'); return true; } }