优化日志记录;

This commit is contained in:
2022-03-19 13:10:02 +08:00
parent 19fa150e57
commit 01adf4261b
2 changed files with 30 additions and 4 deletions

View File

@@ -1,15 +1,22 @@
<?php
use think\facade\App;
use think\facade\Env;
use think\facade\Request;
// +----------------------------------------------------------------------
// | 缓存设置
// +----------------------------------------------------------------------
$default = Env::get('cache.driver', 'file');
if (Request::isCli()) {
$default = 'file';
}
return [
// 默认缓存驱动
'default' => Env::get('cache.driver', 'file'),
'default' => $default,
// 缓存连接方式配置
'stores' => [
@@ -27,6 +34,14 @@ return [
// 序列化机制 例如 ['serialize', 'unserialize']
'serialize' => [],
],
// redis缓存
'redis' => [
// 驱动方式
'type' => 'redis',
// 服务器地址
'host' => '127.0.0.1',
],
// 更多的缓存连接
],
];