cache.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: liu21st <liu21st@gmail.com>
  10. // +----------------------------------------------------------------------
  11. use think\facade\Env;
  12. // +----------------------------------------------------------------------
  13. // | 缓存设置
  14. // +----------------------------------------------------------------------
  15. return [
  16. // 默认缓存驱动
  17. 'default' => Env::get('cache.driver', 'file'),
  18. // 缓存连接方式配置
  19. 'stores' => [
  20. 'file' => [
  21. // 驱动方式
  22. 'type' => 'File',
  23. // 缓存保存目录
  24. 'path' => app()->getRuntimePath() . 'cache' . DIRECTORY_SEPARATOR,
  25. // 缓存前缀
  26. 'prefix' => '',
  27. // 缓存有效期 0表示永久缓存
  28. 'expire' => 0,
  29. // 缓存标签前缀
  30. 'tag_prefix' => 'tag:',
  31. // 序列化机制 例如 ['serialize', 'unserialize']
  32. 'serialize' => [],
  33. ],
  34. // 更多的缓存连接
  35. // redis缓存
  36. 'redis' => [
  37. 'host' => '127.0.0.1',
  38. 'port' => 6379,
  39. 'auth' => '',
  40. //Redis链接密码
  41. 'timeout'=> 5
  42. ],
  43. // 更多的缓存连接
  44. ],
  45. ];
  46. //crmeb
  47. //