当前位置:首页>python>Python学习--__doc__ 属性详解

Python学习--__doc__ 属性详解

  • 2026-07-02 16:40:41
Python学习--__doc__ 属性详解

一、什么是 __doc__ 属性?

__doc__ 是 Python 中的一个特殊属性,用于存储对象(模块、类、函数、方法等)的文档字符串(docstring)。文档字符串是紧接在对象定义之后的三引号字符串,用于解释对象的用途和使用方法。

二、__doc__ 的基本用法

1. 查看模块的文档

# 查看内置模块的文档import mathprint(math.__doc__)# 查看当前模块的文档print(__doc__)  # 当前模块的文档# 自定义模块的文档# mymodule.py"""这是一个自定义模块用于演示文档字符串"""# 导入后查看# import mymodule# print(mymodule.__doc__)

2. 查看函数的文档

def add(a, b):    """    计算两个数的和    参数:        a: 第一个数字        b: 第二个数字    返回:        两个数的和    """    return a + b# 查看函数文档print(add.__doc__)# 查看内置函数文档print(print.__doc__)print(len.__doc__)

3. 查看类的文档

class Person:    """    人员类    属性:        name: 姓名        age: 年龄    方法:        greet(): 问候方法    """    def __init__(self, name, age):        """初始化Person对象"""        self.name = name        self.age = age    def greet(self):        """返回问候语"""        return f"Hello, I'm {self.name}"# 查看类的文档print(Person.__doc__)# 查看方法的文档print(Person.__init__.__doc__)print(Person.greet.__doc__)

三、查看不同对象的文档

1. 使用 help() 函数

def calculate_average(numbers):    """计算数字列表的平均值"""    return sum(numbers) / len(numbers)# 使用 help 查看# help(calculate_average)  # 交互式帮助# 编程方式获取帮助文本import sysfrom io import StringIOdef get_help_text(obj):    """获取对象的帮助文本"""    old_stdout = sys.stdout    sys.stdout = StringIO()    help(obj)    help_text = sys.stdout.getvalue()    sys.stdout = old_stdout    return help_textprint("=== 计算平均值函数的帮助 ===")print(get_help_text(calculate_average)[:500])

2. 使用 pydoc 模块

import pydocdef show_pydoc(obj):    """使用 pydoc 显示文档"""    doc = pydoc.render_doc(obj)    print(doc[:500])  # 打印前500字符# show_pydoc(calculate_average)

四、编写文档字符串的最佳实践

1. 单行文档字符串

def square(x):    """返回数字的平方"""    return x ** 2def is_positive(x):    """判断数字是否为正数"""    return x > 0# 查看print(square.__doc__)print(is_positive.__doc__)

2. 多行文档字符串

class Student:    """    学生类,存储学生信息    这个类用于管理学生的基本信息,    包括姓名、学号、成绩等。    属性:        name (str): 学生姓名        student_id (str): 学号        scores (list): 各科成绩列表    方法:        add_score(course, score): 添加成绩        get_average(): 计算平均分        get_info(): 获取学生信息    """    def __init__(self, name, student_id):        """        初始化学生对象        参数:            name (str): 学生姓名            student_id (str): 学号        """        self.name = name        self.student_id = student_id        self.scores = {}    def add_score(self, course, score):        """        添加学生成绩        参数:            course (str): 课程名称            score (float): 课程成绩        返回:            None        """        self.scores[course] = score    def get_average(self):        """        计算平均分        返回:            float: 所有课程的平均分,如果没有成绩则返回0        """        if not self.scores:            return 0        return sum(self.scores.values()) / len(self.scores)# 查看文档print("=== 类的文档 ===")print(Student.__doc__)print("\n=== 方法的文档 ===")print(Student.add_score.__doc__)print(Student.get_average.__doc__)

3. Google 风格的文档字符串

def process_data(data, options=None, verbose=False):    """    处理数据并返回结果    Args:        data (list): 要处理的数据列表        options (dict, optional): 处理选项,默认为None        verbose (bool, optional): 是否输出详细信息,默认为False    Returns:        dict: 处理后的结果,包含以下字段:            - status (str): 处理状态            - result (list): 处理结果            - elapsed_time (float): 处理耗时    Raises:        ValueError: 当数据为空时抛出        TypeError: 当数据类型不正确时抛出    Example:        >>> process_data([1, 2, 3], verbose=True)        {'status': 'success', 'result': [2, 4, 6], 'elapsed_time': 0.001}    """    if not data:        raise ValueError("数据不能为空")    if verbose:        print(f"处理 {len(data)} 条数据")    result = [x * 2 for x in data]    return {        'status''success',        'result': result,        'elapsed_time'0.001    }print(process_data.__doc__)

4. NumPy/SciPy 风格的文档字符串

def calculate_statistics(data, axis=None, ddof=0):    """    计算数据的统计量    Parameters    ----------    data : array_like        输入数据,可以是列表或数组    axis : int or None, optional        计算轴,默认为None(计算所有元素)    ddof : int, optional        自由度修正,默认为0    Returns    -------    mean : float        平均值    std : float        标准差    var : float        方差    Notes    -----    使用标准公式计算:    - 平均值 = sum(x) / n    - 方差 = sum((x - mean)^2) / (n - ddof)    Examples    --------    >>> calculate_statistics([1, 2, 3, 4, 5])    (3.0, 1.4142135623730951, 2.0)    """    import math    n = len(data)    mean = sum(data) / n    variance = sum((x - mean) ** 2 for x in data) / (n - ddof)    std = math.sqrt(variance)    return mean, std, varianceprint(calculate_statistics.__doc__)

五、查看文档的实用示例

1. 批量查看文档

import inspectdef show_module_docs(module):    """显示模块中所有公开对象的文档"""    print(f"模块: {module.__name__}")    print("=" * 50)    # 显示模块文档    if module.__doc__:        print(f"模块文档:\n{module.__doc__}\n")    # 获取所有成员    for name, obj in inspect.getmembers(module):        if name.startswith('_'):  # 跳过私有成员            continue        if inspect.isfunction(obj) or inspect.isclass(obj):            print(f"{name}:")            if obj.__doc__:                # 显示文档的第一行                doc_lines = obj.__doc__.strip().split('\n')                print(f"  {doc_lines[0]}")            else:                print("  无文档")            print()# 创建一个示例模块def greet(name):    """向指定人员问候"""    return f"Hello, {name}!"class Calculator:    """计算器类,提供基本数学运算"""    def add(self, a, b):        """返回两个数的和"""        return a + b    def multiply(self, a, b):        """返回两个数的积"""        return a * b# 显示当前模块的文档# show_module_docs(sys.modules[__name__])

2. 搜索文档内容

import inspectdef search_docs(module, keyword):    """在模块的文档中搜索关键字"""    results = []    # 搜索模块文档    if module.__doc__ and keyword.lower() in module.__doc__.lower():        results.append(('module', module.__name__))    # 搜索函数和类的文档    for name, obj in inspect.getmembers(module):        if name.startswith('_'):            continue        if hasattr(obj, '__doc__'and obj.__doc__:            if keyword.lower() in obj.__doc__.lower():                results.append((type(obj).__name__, name))    return results# 示例import mathresults = search_docs(math, 'log')print("搜索 'log' 结果:")for obj_type, obj_name in results:    print(f"  {obj_type}{obj_name}")

3. 文档验证工具

def validate_docs(module):    """    验证模块中文档的完整性    检查模块、所有函数和类是否有文档字符串    """    import inspect    issues = []    # 检查模块    if not module.__doc__:        issues.append(f"模块 {module.__name__} 缺少文档")    # 检查函数    for name, obj in inspect.getmembers(module):        if name.startswith('_'):            continue        if inspect.isfunction(obj) and not obj.__doc__:            issues.append(f"函数 {name} 缺少文档")        elif inspect.isclass(obj):            if not obj.__doc__:                issues.append(f"类 {name} 缺少文档")            # 检查类的方法            for method_name, method in inspect.getmembers(obj):                if not method_name.startswith('_'and inspect.isfunction(method):                    if not method.__doc__:                        issues.append(f"方法 {name}.{method_name} 缺少文档")    return issues# 示例class TestClass:    """这个类有文档"""    def method_with_doc(self):        """这个方法有文档"""        pass    def method_without_doc(self):        passdef test_function():    """这个函数有文档"""    passdef test_function_no_doc():    pass# 验证当前模块issues = validate_docs(sys.modules[__name__])if issues:    print("文档问题:")    for issue in issues:        print(f"  - {issue}")else:    print("所有对象都有文档!")

六、动态修改和访问文档

1. 动态添加文档

def dynamic_function(x):    return x * 2# 动态添加文档字符串dynamic_function.__doc__ = "将输入乘以2后返回"# 验证print(dynamic_function.__doc__)# 为类动态添加文档class DynamicClass:    passDynamicClass.__doc__ = "这是一个动态添加文档的类"print(DynamicClass.__doc__)

2. 从文档创建帮助信息

def create_help_text(obj):    """根据文档字符串创建格式化的帮助文本"""    if not hasattr(obj, '__doc__'or not obj.__doc__:        return "没有可用文档"    doc_lines = obj.__doc__.strip().split('\n')    help_text = []    help_text.append("=" * 50)    help_text.append(f"帮助: {obj.__name__ ifhasattr(obj, '__name__'else'object'}")    help_text.append("=" * 50)    for line in doc_lines:        help_text.append(line)    return '\n'.join(help_text)def multiply(a, b):    """    计算两个数的乘积    参数:        a: 第一个乘数        b: 第二个乘数    返回:        乘积结果    """    return a * bprint(create_help_text(multiply))

七、实践应用:文档生成器

class DocGenerator:    """文档生成器,从代码中提取文档"""    def __init__(self, module):        self.module = module        self.module_name = module.__name__    def generate_markdown(self):        """生成 Markdown 格式的文档"""        lines = []        # 标题        lines.append(f"# {self.module_name} 模块文档")        lines.append("")        # 模块文档        if self.module.__doc__:            lines.append("## 模块说明")            lines.append("")            lines.append(self.module.__doc__)            lines.append("")        # 函数文档        lines.append("## 函数")        lines.append("")        for name, obj in inspect.getmembers(self.module):            if name.startswith('_'):  # 跳过私有函数                continue            if inspect.isfunction(obj):                lines.append(f"### `{name}`")                lines.append("")                if obj.__doc__:                    lines.append(obj.__doc__)                else:                    lines.append("*无文档*")                lines.append("")                # 获取签名                try:                    sig = inspect.signature(obj)                    lines.append(f"**签名:** `{name}{sig}`")                    lines.append("")                except:                    pass        # 类文档        lines.append("## 类")        lines.append("")        for name, obj in inspect.getmembers(self.module):            if name.startswith('_'):                continue            if inspect.isclass(obj):                lines.append(f"### `{name}`")                lines.append("")                if obj.__doc__:                    lines.append(obj.__doc__)                else:                    lines.append("*无文档*")                lines.append("")                # 方法文档                methods = []                for method_name, method in inspect.getmembers(obj):                    if (not method_name.startswith('_'and                         inspect.isfunction(method)):                        methods.append(method_name)                if methods:                    lines.append("**方法:**")                    for method_name in methods:                        method = getattr(obj, method_name)                        lines.append(f"- `{method_name}`")                        if method.__doc__:                            lines.append(f"  {method.__doc__.strip()}")                    lines.append("")        return '\n'.join(lines)# 使用示例if __name__ == "__main__":    import inspect    import sys    # 为当前模块生成文档    generator = DocGenerator(sys.modules[__name__])    doc = generator.generate_markdown()    print(doc[:1000])  # 打印前1000字符    # 保存到文件    # with open('module_doc.md', 'w', encoding='utf-8') as f:    #     f.write(doc)

八、总结

__doc__ 属性要点

 对象类型
访问方式
示例
 模块module.__doc__import math; print(math.__doc__)
 函数func.__doc__def f(): pass; print(f.__doc__)
 类class.__doc__class C: pass; print(C.__doc__)
 方法method.__doc__obj.method.__doc__

文档字符串风格

 风格
特点
适用场景
 单行
简洁明了
简单函数、属性
 多行
详细说明
复杂函数、类
 Google风格
结构化
大型项目
 NumPy风格
科学计算
数据分析库

最佳实践

# 1. 始终为公开对象编写文档def public_function():    """提供清晰的文档说明"""    pass# 2. 使用三重引号class Example:    """    使用三重引号编写多行文档    第一行简要描述,空行后详细说明    """    pass# 3. 包含必要信息def complex_function(param1, param2):    """    函数简要描述    Args:        param1: 参数1的说明        param2: 参数2的说明    Returns:        返回值的说明    Raises:        ValueError: 异常触发条件    Examples:        >>> complex_function(1, 2)        3    """    pass# 4. 使用工具检查文档完整性def check_docstrings(module):    """检查模块中哪些对象缺少文档"""    missing = []    for name, obj in inspect.getmembers(module):        if callable(obj) and not name.startswith('_'):            if not obj.__doc__:                missing.append(name)    return missing

__doc__ 属性是 Python 中重要的文档机制,通过良好的文档字符串编写习惯,可以大大提高代码的可读性和可维护性。配合 help()pydoc 等工具,还能自动生成友好的文档。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-03 08:12:18 HTTP/2.0 GET : https://f.mffb.com.cn/a/494837.html
  2. 运行时间 : 0.112552s [ 吞吐率:8.88req/s ] 内存消耗:4,508.45kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=1bd6f66cb156adeae4d438a5997b9ad2
  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.000869s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000865s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.001785s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000412s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000533s ]
  6. SELECT * FROM `set` [ RunTime:0.005811s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000660s ]
  8. SELECT * FROM `article` WHERE `id` = 494837 LIMIT 1 [ RunTime:0.007558s ]
  9. UPDATE `article` SET `lasttime` = 1783037538 WHERE `id` = 494837 [ RunTime:0.012618s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000300s ]
  11. SELECT * FROM `article` WHERE `id` < 494837 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000465s ]
  12. SELECT * FROM `article` WHERE `id` > 494837 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000392s ]
  13. SELECT * FROM `article` WHERE `id` < 494837 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001756s ]
  14. SELECT * FROM `article` WHERE `id` < 494837 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.001370s ]
  15. SELECT * FROM `article` WHERE `id` < 494837 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.006871s ]
0.114119s