设置缓存标签时有时会有报错

浏览:637 发布日期:2020/04/07 分类:ThinkPHP6专区

在设置缓存时,如果设置缓存标签,
Cache::tag('tag')->set('name1','value1');

有时会有报错,大部分时候正常
Argument 1 passed to think\cache\Driver::unserialize() must be of the type string, bool given, called in vendor\topthink\framework\src\think\cache\driver\File.php on line 139


调试后发现在getRaw这个方法里,file_get_contents有时返回的结果是空的
$content = @file_get_contents($filename);

所以才偶尔有这个报错。 麻烦看看


最佳答案
评论( 相关
后面还有条评论,点击查看>>