這里寫描述
按照手冊(cè) composer require -W webman/think-cache安裝cache后
在app的loginController.php里
use think\facade\Cache;
Cache::has('val'); //隨便設(shè)置一個(gè)未有的key 打印都是true
Cache::remember('vals',10);
Cache::get('vals');//值是null
問題:隨便設(shè)置一個(gè)未有的key Cache::has('dss')打印都是true
Cache::remember('vals',10);
Cache::get('vals');打印的值都是null
怎么回事啊?
環(huán)境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,
],
],
];
webman/think-cache 實(shí)際上就是安裝的tp官方的think-cache,這是他們代碼庫,https://github.com/top-think/think-cache
是不是你哪里弄錯(cuò)了,感覺他們不會(huì)有這個(gè)么明顯的bug
全新安裝了webman框架,然后按照文檔composer require -W webman/think-cache
確實(shí)有問題*(如圖)
但是thinkphp框架就事正常的