webman里使用thinphp的cache出现问题

zhuyujin001

问题描述

这里写描述
按照手册 composer require -W webman/think-cache安装cache后
在app的loginController.php里

use think\facade\Cache;
Cache::has('val'); //随便设置一个未有的key 打印都是true
Cache::remember('vals',10);
Cache::get('vals');//值是null

问题:随便设置一个未有的key Cache::has('dss')打印都是true
Cache::remember('vals',10);
Cache::get('vals');打印的值都是null
怎么回事啊?
环境php7.4
config/thinkcache.php

<?php
return [
    'default' => 'file',
    'stores' => [
        'file' => [
            'type' => 'File',
            // 缓存保存目录
            'path' => runtime_path() . '/cache/',
            // 缓存前缀
            'prefix' => '',
            // 缓存有效期 0表示永久缓存
            'expire' => 0,
        ],
        'redis' => [
            'type' => 'redis',
            'host' => '127.0.0.1',
            'port' => 6379,
            'prefix' => '',
            'expire' => 0,
        ],
    ],
];
296 2 0
2个回答

walkor

webman/think-cache 实际上就是安装的tp官方的think-cache,这是他们代码库,https://github.com/top-think/think-cache
是不是你哪里弄错了,感觉他们不会有这个么明显的bug

  • 暂无评论
zhuyujin001


全新安装了webman框架,然后按照文档composer require -W webman/think-cache
确实有问题*(如图)
但是thinkphp框架就事正常的

  • 暂无评论
🔝