当前位置:首页>python>Python IO模块详细介绍

Python IO模块详细介绍

  • 2026-01-29 18:12:41
Python IO模块详细介绍

1. 创始时间与作者

  • 创始时间io 模块作为 Python 标准库的一部分,最初在 Python 2.6 版本中引入(2008年10月发布),作为对传统文件 I/O 系统的现代化改进

  • 核心开发者

    • Python 核心开发团队:包括 Guido van Rossum、Antoine Pitrou 等

    • 主要贡献者:Antoine Pitrou 在 Python 3.x 中对 io 模块进行了重大改进和优化

  • 项目定位:Python 标准库中的输入输出核心模块,提供统一的 I/O 接口,支持文本、二进制和原始 I/O 操作

2. 官方资源

  • Python 文档地址https://docs.python.org/3/library/io.html

  • 源代码位置https://github.com/python/cpython/blob/main/Lib/io.py

  • Python 官方网站https://www.python.org/

3. 核心功能

4. 应用场景

1. 文本文件读写
import io# 写入文本文件with io.open('example.txt''w'encoding='utf-8'as f:f.write('Hello, World!\n')f.write('这是第二行\n')f.write('Third line with emoji 😊\n')# 读取文本文件with io.open('example.txt''r'encoding='utf-8'as f:content = f.read()print("文件内容:")print(content)# 逐行读取with io.open('example.txt''r'encoding='utf-8'as f:print("\n逐行读取:")for iline in enumerate(f1):print(f"行 {i}: {line.strip()}")
2. 二进制文件操作
import io# 写入二进制数据binary_data = b'\x48\x65\x6c\x6c\x6f\x20\x57\x6f\x72\x6c\x64'# "Hello World" in byteswith io.open('binary_data.bin''wb'as f:f.write(binary_data)# 读取二进制文件with io.open('binary_data.bin''rb'as f:data = f.read()print(f"二进制数据: {data}")print(f"转换为文本: {data.decode('utf-8')}")# 使用缓冲读写提高性能with io.open('large_file.bin''rb'buffering=8192as f:chunk = f.read(1024)  # 读取1KB块while chunk:process_chunk(chunk)chunk = f.read(1024)
3. 内存流操作
import io# 使用 StringIO 进行内存文本操作text_stream = io.StringIO()text_stream.write("第一行文本\n")text_stream.write("第二行文本\n")text_stream.write("第三行文本\n")# 获取写入的内容print("StringIO 内容:")text_stream.seek(0)  # 回到开头print(text_stream.read())# 使用 BytesIO 进行内存二进制操作binary_stream = io.BytesIO()binary_stream.write(b'Binary data: ')binary_stream.write(b'\x01\x02\x03\x04\x05')print("\nBytesIO 内容:")binary_stream.seek(0)print(binary_stream.read())# 从字符串创建 StringIOexisting_text = "已有文本\n更多内容"text_stream = io.StringIO(existing_text)print(f"\n从现有文本创建: {text_stream.read()}")
4. 高级 I/O 操作
import ioclass CustomTextWrapper(io.TextIOWrapper):"""自定义文本包装器,添加行号"""def readline(selfsize=-1):line = super().readline(size)if line:return f"{self._line_number}: {line}"return linedef __init__(self*args**kwargs):super().__init__(*args**kwargs)self._line_number = 1# 使用自定义包装器with open('example.txt''rb'as binary_file:with CustomTextWrapper(binary_fileencoding='utf-8'as text_file:for line in text_file:print(line.strip())# 缓冲读写操作def efficient_copy(source_pathdest_pathbuffer_size=8192):"""高效文件复制"""with io.open(source_path'rb'as source:with io.open(dest_path'wb'as dest:while True:chunk = source.read(buffer_size)if not chunk:breakdest.write(chunk)print(f"文件复制完成: {source_path} -> {dest_path}")# 使用示例efficient_copy('example.txt''example_copy.txt')

5. 底层逻辑与技术原理

核心架构
关键技术
  1. I/O 层次结构

    • 原始 I/O(Raw I/O):直接系统调用,无缓冲

    • 缓冲 I/O(Buffered I/O):添加缓冲层提高性能

    • 文本 I/O(Text I/O):处理编码和解码

  2. 缓冲机制

    • 使用内存缓冲区减少系统调用次数

    • 支持全缓冲、行缓冲和无缓冲模式

    • 自动刷新和手动刷新控制

  3. 编码处理

    • 自动处理文本编码和解码

    • 支持错误处理和编码检测

    • Unicode 规范化处理

  4. 流接口

    • 统一的读写接口

    • 支持随机访问和顺序访问

    • 上下文管理器支持


6. 安装与配置

安装说明
# io 是 Python 标准库的一部分,无需单独安装# 从 Python 2.6+ 开始内置支持# 检查 Python 版本python --version# 导入测试python -c"import io; print('io 模块可用')"
版本兼容性
Python 版本io 功能支持
2.6+基本 I/O 功能
3.0+改进的 Unicode 支持
3.1+io.open() 函数
3.2+性能改进和新特性
3.7+新的文本模式特性
依赖关系
  • 必需依赖:无(Python 标准库组件)

  • 系统依赖

    • 操作系统文件系统支持

    • 编码支持(取决于平台)

环境要求
组件最低要求推荐配置
Python2.6+3.8+
内存取决于文件大小和缓冲设置充足内存处理大文件
文件系统支持标准文件操作快速 SSD 存储

7. 性能特点

I/O 类型性能内存使用适用场景
原始 I/O大文件、二进制数据
缓冲 I/O非常高中等大多数文件操作
文本 I/O中等文本文件处理
内存 I/O极高取决于数据大小临时数据处理

注:性能特征基于典型使用场景,实际性能受硬件和操作系统影响


8. 高级功能使用

1. 自定义 I/O 类
import ioimport timeclass TimedFileWrapper(io.TextIOWrapper):"""带计时功能的文件包装器"""def __init__(self*args**kwargs):super().__init__(*args**kwargs)self._operation_count = 0self._total_time = 0.0def read(selfsize=-1):start_time = time.time()result = super().read(size)self._record_operation(time.time() -start_time)return resultdef write(selftext):start_time = time.time()result = super().write(text)self._record_operation(time.time() -start_time)return resultdef _record_operation(selfduration):self._operation_count += 1self._total_time += durationdef get_stats(self):return {'operations'self._operation_count,'total_time'self._total_time,'avg_time'self._total_time/self._operation_count if self._operation_count else 0        }# 使用示例with open('test_file.txt''w+b'asraw_file:with TimedFileWrapper(raw_fileencoding='utf-8'as timed_file:timed_file.write("测试文本\n"*1000)timed_file.seek(0)content = timed_file.read()stats = timed_file.get_stats()print(f"操作统计: {stats}")
2. 流处理和管道
import ioimport gzipimport jsondef create_processing_pipeline():"""创建数据处理管道"""# 模拟数据处理函数def compress_data(data):"""压缩数据"""bio = io.BytesIO()with gzip.GzipFile(fileobj=biomode='wb'as gz:if isinstance(datastr):data = data.encode('utf-8')gz.write(data)return bio.getvalue()def decompress_data(data):"""解压数据"""bio = io.BytesIO(data)with gzip.GzipFile(fileobj=biomode='rb'as gz:return gz.read().decode('utf-8')def process_json_data(data_str):"""处理 JSON 数据"""data = json.loads(data_str)# 添加处理时间戳data['processed_at'] = time.time()return json.dumps(dataensure_ascii=False)return compress_datadecompress_dataprocess_json_data# 使用管道compressdecompressprocess_json = create_processing_pipeline()# 原始数据original_data = {'name''Alice''age'30'city''Beijing'}json_str = json.dumps(original_data)# 通过管道处理compressed = compress(json_str)processed_compressed = compress(process_json(json_str))print(f"原始大小: {len(json_str)} 字节")print(f"压缩后大小: {len(compressed)} 字节")print(f"处理并压缩后大小: {len(processed_compressed)} 字节")# 解压验证decompressed = decompress(processed_compressed)print(f"解压后数据: {decompressed}")
3. 高级缓冲策略
import ioimport threadingclass ThreadSafeBuffer(io.BytesIO):"""线程安全的缓冲区"""def __init__(self*args**kwargs):super().__init__(*args**kwargs)self._lock = threading.RLock()def read(selfsize=-1):with self._lock:return super().read(size)def write(selfdata):with self._lock:return super().write(data)def seek(selfposwhence=io.SEEK_SET):with self._lock:return super().seek(poswhence)def tell(self):with self._lock:return super().tell()class SmartBuffer(io.BufferedRandom):"""智能缓冲区,根据访问模式优化"""def __init__(selfrawbuffer_size=io.DEFAULT_BUFFER_SIZE):super().__init__(rawbuffer_size)self._read_pattern = []self._write_pattern = []def read(selfsize=-1):start_pos = self.tell()data = super().read(size)end_pos = self.tell()# 记录读取模式self._read_pattern.append((start_posend_pos-start_pos))return datadef write(selfdata):start_pos = self.tell()result = super().write(data)end_pos = self.tell()# 记录写入模式self._write_pattern.append((start_poslen(data)))return resultdef get_access_patterns(self):"""获取访问模式分析"""return {'read_patterns'self._read_pattern,'write_patterns'self._write_pattern,'total_reads'len(self._read_pattern),'total_writes'len(self._write_pattern)        }# 使用示例def demonstrate_smart_buffer():bio = io.BytesIO(b'0'*1024)  # 1KB 初始数据smart_buf = SmartBuffer(bio)# 模拟一些操作smart_buf.write(b'Hello')smart_buf.seek(0)data = smart_buf.read(10)smart_buf.write(b'World')smart_buf.seek(5)data = smart_buf.read(5)patterns = smart_buf.get_access_patterns()print("访问模式分析:")for keyvalue in patterns.items():print(f"  {key}: {value}")demonstrate_smart_buffer()
4. I/O 监控和调试
import ioimport functoolsdef monitor_io_operations(stream):"""监控 I/O 操作的装饰器"""class MonitoredStream:def __init__(selfwrapped):self._wrapped = wrappedself.operations = []def __getattr__(selfname):returngetattr(self._wrappedname)def _record_operation(selfop_nameargskwargsresult):self.operations.append({'operation'op_name,'args'args,'kwargs'kwargs,'result'result,'timestamp'time.time()            })def read(selfsize=-1):result = self._wrapped.read(size)self._record_operation('read', (size,), {}, result)return resultdef write(selfdata):result = self._wrapped.write(data)self._record_operation('write', (data,), {}, result)return resultdef seek(selfposwhence=io.SEEK_SET):result = self._wrapped.seek(poswhence)self._record_operation('seek', (poswhence), {}, result)return resultdef get_operations_report(self):"""获取操作报告"""report = {'total_operations'len(self.operations),'read_operations'len([opforopinself.operationsifop['operation'] == 'read']),'write_operations'len([opforopinself.operationsifop['operation'] == 'write']),'seek_operations'len([opforopinself.operationsifop['operation'] == 'seek']),'operations'self.operations            }return reportreturn MonitoredStream(stream)# 使用示例def demonstrate_io_monitoring():# 创建被监控的流original_stream = io.BytesIO()monitored_stream = monitor_io_operations(original_stream)# 执行一些操作monitored_stream.write(b'Hello, ')monitored_stream.write(b'World!')monitored_stream.seek(0)data = monitored_stream.read()monitored_stream.seek(7)partial_data = monitored_stream.read(5)# 获取监控报告report = monitored_stream.get_operations_report()print("I/O 操作监控报告:")print(f"总操作数: {report['total_operations']}")print(f"读取操作: {report['read_operations']}")print(f"写入操作: {report['write_operations']}")print(f"定位操作: {report['seek_operations']}")print("\n详细操作记录:")for iop in enumerate(report['operations']):print(f"  {i+1}. {op['operation']}: {op['args']} -> {op['result']}")demonstrate_io_monitoring()

9. 与相关工具对比

特性io 模块内置 open()第三方 I/O 库低级 os I/O
统一性⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
功能丰富度⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
性能⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
易用性⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
扩展性⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
标准库

10. 最佳实践案例

  1. 大文件处理

    import iodef process_large_file(file_pathchunk_size=8192):"""处理大文件,内存高效"""with io.open(file_path'rb'buffering=chunk_sizeas f:while True:chunk = f.read(chunk_size)if not chunk:break# 处理每个块yield process_chunk(chunk)def process_chunk(chunk):"""处理数据块"""# 模拟处理逻辑return len(chunk)# 使用示例for chunk_size in process_large_file('large_file.dat'):print(f"处理了 {chunk_size} 字节")
  2. 数据格式转换

    import ioimport csvimport jsondef csv_to_json(csv_file_pathjson_file_path):"""CSV 转 JSON 格式"""with io.open(csv_file_path'r'encoding='utf-8'as csv_file:# 读取 CSVreader = csv.DictReader(csv_file)data = list(reader)with io.open(json_file_path'w'encoding='utf-8'as json_file:# 写入 JSONjson.dump(datajson_fileensure_ascii=Falseindent=2)def json_to_csv(json_file_pathcsv_file_path):"""JSON 转 CSV 格式"""with io.open(json_file_path'r'encoding='utf-8'as json_file:data = json.load(json_file)if data:with io.open(csv_file_path'w'encoding='utf-8'newline=''as csv_file:writer = csv.DictWriter(csv_filefieldnames=data[0].keys())writer.writeheader()writer.writerows(data)
  3. 网络数据流处理

    import ioimport requestsdef stream_download(urloutput_pathchunk_size=8192):"""流式下载大文件"""response = requests.get(urlstream=True)response.raise_for_status()with io.open(output_path'wb'as f:for chunk in response.iter_content(chunk_size=chunk_size):if chunk:f.write(chunk)def process_streaming_data(stream_urlprocessor):"""处理流式数据"""response = requests.get(stream_urlstream=True)# 使用 StringIO 或 BytesIO 作为缓冲区buffer = io.BytesIO()for chunk in response.iter_content(chunk_size=1024):if chunk:buffer.write(chunk)# 检查是否完成一个完整的数据单元if b'\n' in chunk:buffer.seek(0)data = buffer.read().decode('utf-8')for line in data.split('\n'):if line.strip():processor(line.strip())buffer = io.BytesIO()
  4. 配置管理系统

    import ioimport configparserclass ConfigManager:"""配置管理器,支持内存和文件配置"""def __init__(self):self.config = configparser.ConfigParser()self.in_memory_config = io.StringIO()def load_from_file(selffile_path):"""从文件加载配置"""with io.open(file_path'r'encoding='utf-8'as f:self.config.read_file(f)def load_from_string(selfconfig_text):"""从字符串加载配置"""self.in_memory_config = io.StringIO(config_text)self.in_memory_config.seek(0)self.config.read_file(self.in_memory_config)def save_to_file(selffile_path):"""保存配置到文件"""with io.open(file_path'w'encoding='utf-8'as f:self.config.write(f)def get_in_memory_config(self):"""获取内存中的配置文本"""self.in_memory_config.seek(0)return self.in_memory_config.read()

总结

io 是 Python 输入输出的核心模块,核心价值在于:

  1. 统一接口:提供一致的 I/O 操作接口

  2. 性能优化:通过缓冲机制提高 I/O 性能

  3. 编码支持:自动处理文本编码和解码

  4. 内存效率:支持流式处理,减少内存占用

技术亮点

  • 分层的 I/O 架构设计

  • 智能缓冲和性能优化

  • 完整的 Unicode 支持

  • 可扩展的流接口

适用场景

  • 文件读写和数据处理

  • 内存中的临时数据操作

  • 网络流和数据管道

  • 大文件处理和流式处理

  • 数据格式转换和序列化

使用方式

import io# Python 标准库,无需安装

学习资源

  • 官方文档:https://docs.python.org/3/library/io.html

  • I/O 编程指南:Python I/O 教程https://docs.python.org/3/tutorial/inputoutput.html

  • 高级用法:Real Python File I/Ohttps://realpython.com/read-write-files-python/

作为 Python 标准库的一部分,io 模块是现代 Python I/O 操作的基础,遵循 Python 软件基金会许可证,可免费用于任何 Python 项目。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-08 01:22:07 HTTP/2.0 GET : https://f.mffb.com.cn/a/468844.html
  2. 运行时间 : 0.109394s [ 吞吐率:9.14req/s ] 内存消耗:4,664.11kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=cbe8a53e327117e246a1b831f99d5600
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000867s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001357s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000613s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000609s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001255s ]
  6. SELECT * FROM `set` [ RunTime:0.000526s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001467s ]
  8. SELECT * FROM `article` WHERE `id` = 468844 LIMIT 1 [ RunTime:0.001181s ]
  9. UPDATE `article` SET `lasttime` = 1770484927 WHERE `id` = 468844 [ RunTime:0.003933s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000579s ]
  11. SELECT * FROM `article` WHERE `id` < 468844 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001006s ]
  12. SELECT * FROM `article` WHERE `id` > 468844 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001098s ]
  13. SELECT * FROM `article` WHERE `id` < 468844 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.004276s ]
  14. SELECT * FROM `article` WHERE `id` < 468844 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.002688s ]
  15. SELECT * FROM `article` WHERE `id` < 468844 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.002985s ]
0.113039s