当前位置:首页>php>PHP数据智能过期:你的缓存还活在石器时代吗?

PHP数据智能过期:你的缓存还活在石器时代吗?

  • 2026-01-30 23:15:47
PHP数据智能过期:你的缓存还活在石器时代吗?

在当今数据驱动的应用程序中,有效管理数据生命周期至关重要。传统的数据过期机制通常依赖固定的时间戳或简单的计数器,但现代应用程序需要更智能的方法。PHP作为一种广泛使用的服务器端脚本语言,提供了多种机制让数据能够"自我感知"其生命周期状态,从而实现智能化的失效管理。

传统方法的局限性

传统的数据生命周期管理通常采用以下方法:

// 传统固定时间过期$cacheData = ['value' => '一些数据','expires_at' => time() + 3600// 1小时后固定过期];// 检查是否过期if (time() > $cacheData['expires_at']) {// 数据已过期,需要刷新}

这种方法虽然简单,但缺乏灵活性。数据要么有效,要么失效,没有中间状态,也无法根据实际使用情况调整生命周期。

智能化的PHP数据生命周期策略

1. 基于使用频率的自适应过期

让PHP根据数据被访问的频率动态调整其生命周期:

classAdaptiveCacheItem{private $value;private $createdAt;private $accessCount = 0;private $lastAccessed;private $baseTTL;publicfunction__construct($value, $baseTTL = 3600){$this->value = $value;$this->createdAt = time();$this->lastAccessed = time();$this->baseTTL = $baseTTL;    }publicfunctiongetValue(){$this->accessCount++;$this->lastAccessed = time();return$this->value;    }publicfunctionisExpired(){// 高频访问的数据获得更长的生命周期        $adaptiveTTL = $this->baseTTL * (1 + log10($this->accessCount + 1));// 最近访问过的数据获得额外生命        $timeSinceLastAccess = time() - $this->lastAccessed;        $recentAccessBonus = max(0300 - $timeSinceLastAccess); // 最近访问奖励最多5分钟        $effectiveExpiry = $this->createdAt + $adaptiveTTL + $recentAccessBonus;return time() > $effectiveExpiry;    }}
2. 基于内容新鲜度需求的动态过期

某些数据对新鲜度要求更高,PHP可以根据数据类型或内容特征决定过期策略:

classContentAwareCache{private $cache = [];publicfunctionset($key, $value, $contentType){        $ttl = $this->determineTTLByContent($contentType);$this->cache[$key] = ['value' => $value,'expires_at' => time() + $ttl,'content_type' => $contentType,'priority' => $this->getContentPriority($contentType)        ];return$this;    }privatefunctiondetermineTTLByContent($contentType){// 根据内容类型决定TTL        $ttlMap = ['news' => 300,           // 新闻:5分钟'exchange_rate' => 30,   // 汇率:30秒'user_profile' => 86400// 用户资料:1天'static_content' => 604800// 静态内容:7天        ];return $ttlMap[$contentType] ?? 3600// 默认1小时    }privatefunctiongetContentPriority($contentType){// 根据内容类型确定优先级,用于内存不足时清理        $priorityMap = ['news' => 3,'exchange_rate' => 1// 最高优先级'user_profile' => 2,'static_content' => 4// 最低优先级        ];return $priorityMap[$contentType] ?? 5;    }publicfunctioncleanup(){// 先移除过期项目foreach ($this->cache as $key => $item) {if (time() > $item['expires_at']) {unset($this->cache[$key]);            }        }// 如果仍然内存不足,按优先级清理if ($this->isMemoryLow()) {$this->removeLowPriorityItems();        }    }}
3. 基于外部条件触发的失效机制

让PHP能够响应外部事件或条件来决定数据是否失效:

classEventDrivenCache{private $cache = [];private $eventHandlers = [];publicfunction__construct(){// 注册事件处理器$this->registerEventHandlers();    }publicfunctionset($key, $value, $triggers = []){$this->cache[$key] = ['value' => $value,'triggers' => $triggers, // 导致此数据失效的事件列表'is_valid' => true        ];return$this;    }publicfunctionget($key){if (!isset($this->cache[$key]) || !$this->cache[$key]['is_valid']) {returnnull;        }return$this->cache[$key]['value'];    }publicfunctiontriggerEvent($eventName, $eventData = []){// 触发事件,让相关数据失效foreach ($this->cache as $key => $item) {if (in_array($eventName, $item['triggers'])) {// 可以在这里添加更复杂的失效逻辑if ($this->shouldInvalidate($eventName, $key, $eventData)) {$this->cache[$key]['is_valid'] = false;                }            }        }// 执行注册的事件处理器if (isset($this->eventHandlers[$eventName])) {foreach ($this->eventHandlers[$eventName] as $handler) {                $handler($eventData, $this);            }        }    }privatefunctionshouldInvalidate($event, $key, $eventData){// 实现智能判断逻辑,决定是否真的需要失效// 例如:只有特定用户的数据更新时,才使该用户相关的缓存失效// 示例:如果事件是用户更新,只使该用户的缓存失效if ($event === 'user_updated' && isset($eventData['user_id'])) {return$this->isUserRelatedCache($key, $eventData['user_id']);        }returntrue// 默认失效    }}
4. 多层生命周期状态管理

数据可以具有多个生命周期阶段,而不是简单的"有效/失效":

classMultiStageCacheItem{const STAGE_FRESH = 'fresh';        // 完全新鲜const STAGE_STALE = 'stale';        // 陈旧,但仍可使用const STAGE_REFRESHING = 'refreshing'// 正在刷新const STAGE_EXPIRED = 'expired';    // 已过期private $value;private $createdAt;private $staleThreshold;private $expiryThreshold;private $currentStage;private $refreshCallback;publicfunction__construct($value, $refreshCallback, $staleAfter = 300, $expireAfter = 3600){$this->value = $value;$this->createdAt = time();$this->staleThreshold = $staleAfter;$this->expiryThreshold = $expireAfter;$this->refreshCallback = $refreshCallback;$this->currentStage = self::STAGE_FRESH;    }publicfunctiongetValue(){$this->updateStage();switch ($this->currentStage) {caseself::STAGE_FRESH:caseself::STAGE_STALE:// 启动异步刷新如果处于陈旧状态if ($this->currentStage === self::STAGE_STALE) {$this->initiateBackgroundRefresh();                }return$this->value;caseself::STAGE_REFRESHING:// 返回旧值,同时刷新return$this->value;caseself::STAGE_EXPIRED:// 阻塞直到获取新值$this->refreshValue();return$this->value;        }    }privatefunctionupdateStage(){        $age = time() - $this->createdAt;if ($age < $this->staleThreshold) {$this->currentStage = self::STAGE_FRESH;        } elseif ($age < $this->expiryThreshold) {$this->currentStage = self::STAGE_STALE;        } else {$this->currentStage = self::STAGE_EXPIRED;        }    }privatefunctioninitiateBackgroundRefresh(){// 避免重复刷新static $refreshing = false;if (!$refreshing && $this->currentStage === self::STAGE_STALE) {            $refreshing = true;$this->currentStage = self::STAGE_REFRESHING;// 在实际应用中,这里可以使用消息队列、异步任务等            register_shutdown_function(function(){$this->refreshValue();            });        }    }privatefunctionrefreshValue(){if (is_callable($this->refreshCallback)) {$this->value = call_user_func($this->refreshCallback);$this->createdAt = time();$this->currentStage = self::STAGE_FRESH;        }    }publicfunctiongetStage(){$this->updateStage();return$this->currentStage;    }}
5. 机器学习辅助的过期预测(高级技巧)

对于高流量应用,可以使用简单的模式识别来预测数据的最佳生命周期:

classPredictiveCacheManager{private $accessPatterns = [];private $cache = [];private $learningRate = 0.1// 学习率publicfunctionget($key){        $currentTime = time();// 记录访问模式$this->recordAccessPattern($key, $currentTime);if (!isset($this->cache[$key]) || $currentTime > $this->cache[$key]['expires_at']) {// 缓存未命中,获取新数据            $value = $this->fetchData($key);            $ttl = $this->predictOptimalTTL($key);$this->cache[$key] = ['value' => $value,'expires_at' => $currentTime + $ttl,'predicted_ttl' => $ttl            ];        }return$this->cache[$key]['value'];    }privatefunctionrecordAccessPattern($key, $timestamp){if (!isset($this->accessPatterns[$key])) {$this->accessPatterns[$key] = [];        }$this->accessPatterns[$key][] = $timestamp;// 保持最近100次访问记录if (count($this->accessPatterns[$key]) > 100) {            array_shift($this->accessPatterns[$key]);        }    }privatefunctionpredictOptimalTTL($key){if (!isset($this->accessPatterns[$key]) || count($this->accessPatterns[$key]) < 5) {return3600// 默认TTL        }        $accessTimes = $this->accessPatterns[$key];// 计算平均访问间隔        $intervals = [];for ($i = 1; $i < count($accessTimes); $i++) {            $intervals[] = $accessTimes[$i] - $accessTimes[$i-1];        }        $averageInterval = array_sum($intervals) / count($intervals);// 使用简单指数平滑调整TTL        $currentTTL = isset($this->cache[$key]) ? $this->cache[$key]['predicted_ttl'] : 3600;        $newTTL = $currentTTL * (1 - $this->learningRate) + $averageInterval * $this->learningRate;// 确保TTL在合理范围内return max(60, min(86400, $newTTL)); // 介于1分钟到1天之间    }}

实践建议与最佳实践

1. 分层缓存策略
  • L1缓存:使用APCu或内存缓存存储极短期数据
  • L2缓存:使用Redis或Memcached存储中期数据
  • L3缓存:数据库或持久化存储

2. 监控与调优

classCacheMetrics{private $hits = 0;private $misses = 0;private $staleServes = 0;private $startTime;publicfunction__construct(){$this->startTime = microtime(true);    }publicfunctionrecordHit($isStale = false){$this->hits++;if ($isStale) {$this->staleServes++;        }    }publicfunctionrecordMiss(){$this->misses++;    }publicfunctiongetHitRate(){        $total = $this->hits + $this->misses;return $total > 0 ? ($this->hits / $total) * 100 : 0;    }publicfunctiongetStaleRate(){return$this->hits > 0 ? ($this->staleServes / $this->hits) * 100 : 0;    }publicfunctiongetReport(){return ['hit_rate' => round($this->getHitRate(), 2) . '%','stale_rate' => round($this->getStaleRate(), 2) . '%','total_requests' => $this->hits + $this->misses,'uptime' => round(microtime(true) - $this->startTime, 2) . 's'        ];    }}
3. 实施降级策略

当外部服务不可用时,智能延长缓存生命周期:

classGracefulDegradationCache{private $cache = [];private $serviceHealth = [];publicfunctionget($key, $fetchCallback){if (isset($this->cache[$key]) && !$this->isExpired($key)) {return$this->cache[$key]['value'];        }try {            $value = $fetchCallback();            $ttl = $this->determineTTL($key);$this->cache[$key] = ['value' => $value,'expires_at' => time() + $ttl            ];// 标记服务为健康$this->markServiceHealthy($key);return $value;        } catch (ServiceUnavailableException $e) {// 服务不可用,延长现有缓存的生命周期if (isset($this->cache[$key])) {$this->extendTTL($key, 600); // 延长10分钟$this->markServiceUnhealthy($key);return$this->cache[$key]['value'];            }throw $e; // 没有可用的缓存数据        }    }privatefunctiondetermineTTL($key){// 如果服务不健康,使用较长的TTLif (!$this->isServiceHealthy($key)) {return600// 10分钟        }return60// 正常情况1分钟    }}

结论

让PHP决定数据何时失效,而不是依赖固定的过期时间,可以显著提高应用程序的性能和资源利用率。通过实现自适应的、基于使用模式的和条件触发的生命周期管理策略,开发者可以创建更智能、更高效的缓存系统。

关键要点包括:

  1. 从固定TTL转向动态TTL
  2. 实施多层失效状态(新鲜、陈旧、过期)
  3. 基于实际使用模式调整生命周期
  4. 建立响应外部事件的失效机制
  5. 监控缓存效果并持续优化

这些技巧不仅适用于缓存系统,还可以应用于会话管理、API响应缓存、数据库查询结果缓存等多个场景,帮助构建更加健壮和高效的PHP应用程序。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-08 06:17:49 HTTP/2.0 GET : https://f.mffb.com.cn/a/465691.html
  2. 运行时间 : 0.198529s [ 吞吐率:5.04req/s ] 内存消耗:4,834.86kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=5b4510c1c25e6ef378ac2371aa28bcc7
  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.001145s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001633s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000682s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000591s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001287s ]
  6. SELECT * FROM `set` [ RunTime:0.000483s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001398s ]
  8. SELECT * FROM `article` WHERE `id` = 465691 LIMIT 1 [ RunTime:0.001042s ]
  9. UPDATE `article` SET `lasttime` = 1770502670 WHERE `id` = 465691 [ RunTime:0.017845s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 64 LIMIT 1 [ RunTime:0.000887s ]
  11. SELECT * FROM `article` WHERE `id` < 465691 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001111s ]
  12. SELECT * FROM `article` WHERE `id` > 465691 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001219s ]
  13. SELECT * FROM `article` WHERE `id` < 465691 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001664s ]
  14. SELECT * FROM `article` WHERE `id` < 465691 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.001977s ]
  15. SELECT * FROM `article` WHERE `id` < 465691 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.001803s ]
0.202059s