app.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * @desc app.php 描述信息
  4. *
  5. * @author yym
  6. * @date 2022/7/28
  7. */
  8. return [
  9. 'enable' => true,
  10. 'storage' => [
  11. 'default' => 'local', // local:本地 oss:阿里云 cos:腾讯云 qos:七牛云
  12. 'single_limit' => 1024 * 1024 * 100, // 单个文件的大小限制,默认200M 1024 * 1024 * 200
  13. 'total_limit' => 1024 * 1024 * 200, // 所有文件的大小限制,默认200M 1024 * 1024 * 200
  14. 'nums' => 5, // 文件数量限制,默认10
  15. 'include' => ['png', 'jpg', 'jpeg', 'gif', 'mp4', 'mp3', 'xlsx', 'xls'], // 被允许的文件类型列表
  16. 'exclude' => [], // 不被允许的文件类型列表
  17. // 本地对象存储
  18. 'local' => [
  19. 'adapter' => \Tinywan\Storage\Adapter\LocalAdapter::class,
  20. 'root' => public_path().'/storage/',
  21. 'dirname' => function () {
  22. return date('Ymd');
  23. },
  24. 'domain' => 'http://op.wanyuewellness.cn',
  25. 'uri' => '/storage/', // 如果 domain + uri 不在 public 目录下,请做好软链接,否则生成的url无法访问
  26. 'algo' => 'sha1',
  27. ],
  28. // 阿里云对象存储
  29. 'oss' => [
  30. 'adapter' => \Tinywan\Storage\Adapter\OssAdapter::class,
  31. 'accessKeyId' => 'xxxxxxxxxxxx',
  32. 'accessKeySecret' => 'xxxxxxxxxxxx',
  33. 'bucket' => 'resty-webman',
  34. 'dirname' => function () {
  35. return 'storage';
  36. },
  37. 'domain' => '',
  38. 'endpoint' => 'oss-cn-hangzhou.aliyuncs.com',
  39. 'algo' => 'sha1',
  40. ],
  41. // 腾讯云对象存储
  42. 'cos' => [
  43. 'adapter' => \Tinywan\Storage\Adapter\CosAdapter::class,
  44. 'secretId' => 'xxxxxxxxxxxxx',
  45. 'secretKey' => 'xxxxxxxxxxxx',
  46. 'bucket' => 'resty-webman-xxxxxxxxx',
  47. 'dirname' => 'storage',
  48. 'domain' => '',
  49. 'region' => 'ap-shanghai',
  50. ],
  51. // 七牛云对象存储
  52. 'qiniu' => [
  53. 'adapter' => \Tinywan\Storage\Adapter\QiniuAdapter::class,
  54. 'accessKey' => 'xxxxxxxxxxxxx',
  55. 'secretKey' => 'xxxxxxxxxxxxx',
  56. 'bucket' => 'resty-webman',
  57. 'dirname' => 'storage',
  58. 'domain' => '',
  59. ],
  60. ],
  61. ];