You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong/config/cache.php

57 lines
1.8 KiB

8 months ago
<?php
// +----------------------------------------------------------------------
// | 缓存设置
// +----------------------------------------------------------------------
// 设置绝对路径
// 因为在console中使用cache会导致找不到正确的runtime目录, 所以此处不能使用相对路径
$rootPath = dirname(__DIR__);
return [
// 默认缓存驱动
'default' => env('cache.driver', 'file'),
// 缓存连接方式配置
8 months ago
'stores' => [
8 months ago
'file' => [
// 驱动方式
8 months ago
'type' => 'File',
8 months ago
// 缓存保存目录
8 months ago
'path' => "{$rootPath}/runtime/cache/",
8 months ago
// 缓存前缀
8 months ago
'prefix' => env('cache.prefix', ''),
8 months ago
// 缓存有效期 0表示永久缓存
8 months ago
'expire' => 0,
8 months ago
// 缓存标签前缀
'tag_prefix' => 'tag:',
// 序列化机制 例如 ['serialize', 'unserialize']
8 months ago
'serialize' => [],
8 months ago
],
// 更多的缓存连接
// redis缓存
8 months ago
'redis' => [
8 months ago
// 驱动方式
8 months ago
'type' => 'redis',
8 months ago
// 服务器地址
8 months ago
'host' => env('redis.hostname', '127.0.0.1'),
8 months ago
// 端口
8 months ago
'port' => (int)env('redis.hostport', '6379'),
8 months ago
// 密码
8 months ago
'password' => env('redis.password', ''),
8 months ago
// 缓存有效期 0表示永久缓存
8 months ago
'expire' => 0,
8 months ago
// 缓存前缀
8 months ago
'prefix' => env('redis.prefix', ''),
8 months ago
// 缓存标签前缀
8 months ago
'tag_prefix' => 'tag:',
8 months ago
// 数据库 0号数据库
8 months ago
'select' => (int)env('redis.select', 0),
8 months ago
// 序列化机制 例如 ['serialize', 'unserialize']
8 months ago
'serialize' => [],
8 months ago
// 服务端超时
8 months ago
'timeout' => 0
8 months ago
],
],
];