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

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