乐于分享
好东西不私藏

MyBatis 源码解读(六):插件机制与 InterceptorChain——在不改的情况下"插一刀"

MyBatis 源码解读(六):插件机制与 InterceptorChain——在不改的情况下"插一刀"

写在前面

MyBatis 的插件机制是框架扩展能力的核心。分页插件 PageHelper、性能监控插件、SQL 日志插件……这些都不需要改 MyBatis 源码,只需要实现一个接口、加几个注解,就能在 Executor、StatementHandler、ParameterHandler、ResultSetHandler 的执行链路上"插一脚"。

这篇文章我们拆解插件是怎么被注册、怎么被触发、以及分页插件的底层原理。读完之后你应该能回答:为什么插件只能拦截这四个接口?动态代理 + 责任链是怎么配合工作的?

一、插件的入口:Interceptor 接口

要写一个 MyBatis 插件,只需要实现一个接口:

publicinterfaceInterceptor{Object intercept(Invocation invocation)throws Throwable;default Object plugin(Object target){return Plugin.wrap(target, this);    }defaultvoidsetProperties(Properties properties){// NOP    }}

三个方法:

  1. intercept —— 核心拦截逻辑,插件在这里写自己的代码
  2. plugin —— 生成代理对象,默认用 Plugin.wrap()
  3. setProperties —— 接收 XML 里配置的 <property>

以分页插件为例:

@Intercepts({@Signature(type = StatementHandler.class,method"prepare",        args = {Connection.classInteger.class})})publicclassPaginationInterceptorimplementsInterceptor{@Overridepublic Object intercept(Invocation invocation)throws Throwable {        StatementHandler statementHandler =            (StatementHandler) invocation.getTarget();// 获取 BoundSql,改写 SQL 添加 LIMIT        MetaObject metaObject = SystemMetaObject            .forObject(statementHandler);        BoundSql boundSql = (BoundSql) metaObject            .getValue("delegate.boundSql");        String originalSql = boundSql.getSql();        String pageSql = originalSql + " LIMIT ?, ?";        metaObject.setValue("delegate.boundSql.sql", pageSql);// 继续执行原方法return invocation.proceed();    }}

@Intercepts 和 @Signature 注解告诉 MyBatis:我要拦截谁(StatementHandler)的哪个方法(prepare),参数类型是什么(Connection.class, Integer.class)。

二、Plugin.wrap:生成代理对象

Plugin.wrap() 是 MyBatis 插件的核心——它用 JDK 动态代理给目标对象套上一层壳:

publicclassPluginimplementsInvocationHandler{privatefinal Object target;privatefinal Interceptor interceptor;privatefinal Map<Class<?>, Set<Method>>        signatureMap;privatePlugin(Object target,            Interceptor interceptor,            Map<Class<?>, Set<Method>> signatureMap){this.target = target;this.interceptor = interceptor;this.signatureMap = signatureMap;    }publicstatic Object wrap(Object target,            Interceptor interceptor){        Map<Class<?>, Set<Method>> signatureMap =            getSignatureMap(interceptor);        Class<?> type = target.getClass();        Class<?>[] interfaces = getAllInterfaces(            type, signatureMap);if (interfaces.length > 0) {return Proxy.newProxyInstance(                type.getClassLoader(),                interfaces,new Plugin(target, interceptor,                    signatureMap));        }return target;    }@Overridepublic Object invoke(Object proxy, Method method,            Object[] args)throws Throwable {try {            Set<Method> methods =                signatureMap.get(method.getDeclaringClass());if (methods != null && methods.contains(method)) {return interceptor.intercept(new Invocation(target, method, args));            }return method.invoke(target, args);        } catch (Exception e) {throw ExceptionUtil.unwrapThrowable(e);        }    }}

Plugin.wrap() 的逻辑:

  1. 解析 @Signature 注解,生成 signatureMap(拦截的接口类 → 方法集合)
  2. 检查目标对象是否实现了这些接口
  3. 如果实现了,生成代理对象;如果没实现,原样返回
  4. invoke() 时,判断当前调用的方法是否在 signatureMap 里
  5. 如果在 → 调用 interceptor.intercept()(走插件逻辑)
  6. 如果不在 → 直接调用原方法

这就像给房子加了一层防盗门:门上有猫眼(signatureMap 判断),如果是你认识的人(被拦截的方法),开门检查(执行插件逻辑);如果不是,直接放行(走原方法)。

getSignatureMap:解析注解

privatestatic Map<Class<?>, Set<Method>> getSignatureMap(        Interceptor interceptor) {    Intercepts interceptsAnnotation =        interceptor.getClass()            .getAnnotation(Intercepts.class);if (interceptsAnnotation == null) {thrownew PluginException("No @Intercepts annotation was found in "            + "interceptor " + interceptor.getClass());    }    Signature[] sigs =        interceptsAnnotation.value();    Map<Class<?>, Set<Method>> signatureMap =new HashMap<>();for (Signature sig : sigs) {        Set<Method> methods = signatureMap            .computeIfAbsent(sig.type(),                k -> new HashSet<>());try {            Method method = sig.type()                .getMethod(sig.method(), sig.args());            methods.add(method);        } catch (NoSuchMethodException e) {thrownew PluginException("Could not find method on "                + sig.type() + " named " + sig.method()                + ". Cause: " + e, e);        }    }return signatureMap;}

解析 @Intercepts 注解,提取每个 @Signature 里声明的接口类型、方法名、参数类型,然后反射获取 Method 对象,存入 Map。

三、InterceptorChain:责任链的组装

单个插件是代理,多个插件就是责任链(Chain of Responsibility)。InterceptorChain 负责把多个插件串起来:

publicclassInterceptorChain{privatefinal List<Interceptor> interceptors =new ArrayList<>();public Object pluginAll(Object target){for (Interceptor interceptor : interceptors) {            target = interceptor.plugin(target);        }return target;    }publicvoidaddInterceptor(            Interceptor interceptor){        interceptors.add(interceptor);    }public List<Interceptor> getInterceptors(){return Collections.unmodifiableList(interceptors);    }}

pluginAll() 是核心——遍历所有插件,逐个给目标对象套代理。套了一层又一层,像洋葱一样。

原始对象(Executor/StatementHandler/...)    │    ▼Plugin.wrap(原始对象, 插件A) —— 第1层代理    │    ▼Plugin.wrap(第1层代理, 插件B) —— 第2层代理    │    ▼Plugin.wrap(第2层代理, 插件C) —— 第3层代理

调用的时候,最外层代理的 invoke 先执行。如果方法被拦截了,进入 interceptor.intercept()intercept() 里通常最后会调 invocation.proceed(),触发下一层。

这就像俄罗斯套娃:你打开一个,里面还有一个,再打开,里面还有一个。每一层都是一个插件的拦截逻辑。

Invocation:封装调用上下文

publicclassInvocation{privatefinal Object target;privatefinal Method method;privatefinal Object[] args;public Object proceed()throws InvocationTargetException,            IllegalAccessException {return method.invoke(target, args);    }}

Invocation 封装了"被拦截的方法调用"。proceed() 是继续执行原方法(或者下一层代理的 invoke)。插件里通常这样写:

public Object intercept(Invocation invocation)throws Throwable {// 1. 前置逻辑(比如改写 SQL)    doSomethingBefore();// 2. 继续执行    Object result = invocation.proceed();// 3. 后置逻辑(比如统计耗时)    doSomethingAfter();return result;}

四、插件的植入时机:四大组件都被包裹

MyBatis 在创建四大组件时,都会调用 interceptorChain.pluginAll()

// Configuration.javapublic Executor newExecutor(Transaction transaction,        ExecutorType executorType){    executorType = ...;    Executor executor;if (...) {        executor = new BatchExecutor(this, transaction);    } elseif (...) {        executor = new ReuseExecutor(this, transaction);    } else {        executor = new SimpleExecutor(this, transaction);    }if (cacheEnabled) {        executor = new CachingExecutor(executor);    }    executor = (Executor) interceptorChain.pluginAll(executor);return executor;}public StatementHandler newStatementHandler(        Executor executor, MappedStatement mappedStatement,        Object parameterObject, RowBounds rowBounds,        ResultHandler resultHandler, BoundSql boundSql){    StatementHandler statementHandler =new RoutingStatementHandler(executor, mappedStatement,            parameterObject, rowBounds, resultHandler, boundSql);    statementHandler = (StatementHandler)        interceptorChain.pluginAll(statementHandler);return statementHandler;}public ParameterHandler newParameterHandler(        MappedStatement mappedStatement,        Object parameterObject, BoundSql boundSql){    ParameterHandler parameterHandler =        mappedStatement.getLang().createParameterHandler(            mappedStatement, parameterObject, boundSql);    parameterHandler = (ParameterHandler)        interceptorChain.pluginAll(parameterHandler);return parameterHandler;}public ResultSetHandler newResultSetHandler(        Executor executor, MappedStatement mappedStatement,        RowBounds rowBounds, ParameterHandler parameterHandler,        ResultHandler resultHandler, BoundSql boundSql){    ResultSetHandler resultSetHandler =new DefaultResultSetHandler(executor, mappedStatement,            parameterHandler, resultHandler, boundSql, rowBounds);    resultSetHandler = (ResultSetHandler)        interceptorChain.pluginAll(resultSetHandler);return resultSetHandler;}

四大组件,每个创建后都会被 pluginAll 包裹。这就是为什么插件可以作用于这四个接口——MyBatis 只在这四个地方植入了插件拦截点。

你可能会问:为什么不能拦截其他方法?比如 SqlSession.insert()

因为 pluginAll 只在这四个地方被调用。SqlSession 不是通过代理创建的,所以没有拦截点。如果你想拦截 SqlSession 的方法,只能在外层(比如 Spring AOP)做文章。

五、分页插件的原理:改写 BoundSql

以 PageHelper 为例,它是怎么做到自动分页的?

  1. **拦截 Executor.query**:在查询执行前,提取分页参数(页码、页大小)
  2. 改写 SQL:把原始 SQL 包装成 count 查询,统计总记录数
  3. 再次查询:用改写后的 SQL(带 LIMIT)执行真正的分页查询
  4. 封装结果:把结果列表和总记录数封装成 PageInfo 返回
@Intercepts({@Signature(type = Executor.class,method"query",        args = {MappedStatement.classObject.class,RowBounds.classResultHandler.class})})publicclassPageInterceptorimplementsInterceptor{@Overridepublic Object intercept(Invocation invocation)throws Throwable {        Object[] args = invocation.getArgs();        MappedStatement ms = (MappedStatement) args[0];        Object parameter = args[1];        RowBounds rowBounds = (RowBounds) args[2];// 检查是否需要分页if (rowBounds instanceof PageRowBounds) {// 1. 执行 count 查询            Long count = executeCount(invocation, ms, parameter);// 2. 改写 SQL,添加 LIMIT            BoundSql boundSql = ms.getBoundSql(parameter);            String pageSql = boundSql.getSql()                + " LIMIT " + rowBounds.getOffset()                + ", " + rowBounds.getLimit();// 3. 创建新的 MappedStatement,替换 BoundSql// ...        }return invocation.proceed();    }}

PageHelper 的巧妙之处在于:它利用了 RowBounds 这个本来用于内存分页的参数,把它变成了物理分页的标志。当 RowBounds 是 PageRowBounds(PageHelper 的自定义子类)时,触发分页逻辑;否则走原来的内存分页。

六、多个插件的执行顺序

插件执行顺序 = 注册顺序。interceptorChain 的 interceptors 列表是按注册顺序排列的,先注册的先执行(最外层),后注册的后执行(最内层)。

<plugins><plugininterceptor="com.example.PluginA"/><plugininterceptor="com.example.PluginB"/><plugininterceptor="com.example.PluginC"/></plugins>

执行顺序:

PluginA.intercept() {    // A 的前置逻辑    → PluginB.intercept() {        // B 的前置逻辑        → PluginC.intercept() {            // C 的前置逻辑            → invocation.proceed() → 原始方法            // C 的后置逻辑        }        // B 的后置逻辑    }    // A 的后置逻辑}

这就像三个人排队过安检:A 先检查,然后让 B 检查,B 让 C 检查,C 检查完放行了,然后 C 出来,B 出来,A 出来。每个人都可以在"进去"和"出来"的时候做自己的事。

七、插件机制的局限性

MyBatis 插件虽然强大,但也有明显的限制:

  1. 只能拦截四个接口:Executor、StatementHandler、ParameterHandler、ResultSetHandler
  2. 只能拦截接口方法:不能拦截类的私有方法
  3. 签名匹配必须精确:方法名和参数类型必须完全一致
  4. 代理嵌套多了有性能开销:每个插件都套一层代理,调用链变长

八、小结

插件注册    │    ▼InterceptorChain.addInterceptor()    │    ▼运行时创建四大组件    │    ├── new Executor()    ├── new StatementHandler()    ├── new ParameterHandler()    └── new ResultSetHandler()    │    ▼interceptorChain.pluginAll(target)    │    ├── Plugin.wrap(target, 插件A) → 代理A    ├── Plugin.wrap(代理A, 插件B) → 代理B    └── Plugin.wrap(代理B, 插件C) → 代理C    │    ▼方法调用时    │    ├── 代理C.invoke() → 检查 signatureMap → 匹配?→ 插件C.intercept()    │       └── invocation.proceed() → 代理B.invoke()    │               └── 代理B.invoke() → 检查 → 插件B.intercept()    │                       └── invocation.proceed() → 代理A.invoke()    │                               └── ... → 原始方法    └── 不匹配 → method.invoke(target, args) → 直接调用

下篇预告

下一篇讲缓存——MyBatis 的一级缓存和二级缓存是怎么工作的?缓存键怎么生成?什么时候会失效?这也是面试最爱问的问题之一。


本系列文章基于 MyBatis 3.5.x 源码,写作时对照源码逐行验证。如果发现有问题的地方,欢迎指正。

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