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.

94 lines
3.3 KiB

  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. return [
  12. 'default' => 'oss',
  13. 'storage' => [
  14. 'local' => [
  15. 'driver' => \Hyperf\Filesystem\Adapter\LocalAdapterFactory::class,
  16. 'root' => BASE_PATH . '/attachment',
  17. ],
  18. 'ftp' => [
  19. 'driver' => \Hyperf\Filesystem\Adapter\FtpAdapterFactory::class,
  20. 'host' => 'ftp.example.com',
  21. 'username' => 'username',
  22. 'password' => 'password',
  23. // 'port' => 21,
  24. // 'root' => '/path/to/root',
  25. // 'passive' => true,
  26. // 'ssl' => true,
  27. // 'timeout' => 30,
  28. // 'ignorePassiveAddress' => false,
  29. ],
  30. 'memory' => [
  31. 'driver' => \Hyperf\Filesystem\Adapter\MemoryAdapterFactory::class,
  32. ],
  33. 's3' => [
  34. 'driver' => \Hyperf\Filesystem\Adapter\S3AdapterFactory::class,
  35. 'credentials' => [
  36. 'key' => env('S3_KEY'),
  37. 'secret' => env('S3_SECRET'),
  38. ],
  39. 'region' => env('S3_REGION'),
  40. 'version' => 'latest',
  41. 'bucket_endpoint' => false,
  42. 'use_path_style_endpoint' => false,
  43. 'endpoint' => env('S3_ENDPOINT'),
  44. 'bucket_name' => env('S3_BUCKET'),
  45. ],
  46. 'minio' => [
  47. 'driver' => \Hyperf\Filesystem\Adapter\S3AdapterFactory::class,
  48. 'credentials' => [
  49. 'key' => env('S3_KEY'),
  50. 'secret' => env('S3_SECRET'),
  51. ],
  52. 'region' => env('S3_REGION'),
  53. 'version' => 'latest',
  54. 'bucket_endpoint' => false,
  55. 'use_path_style_endpoint' => true,
  56. 'endpoint' => env('S3_ENDPOINT'),
  57. 'bucket_name' => env('S3_BUCKET'),
  58. ],
  59. 'oss' => [
  60. 'driver' => \Hyperf\Filesystem\Adapter\AliyunOssAdapterFactory::class,
  61. 'accessId' => env('OSS_ACCESS_ID'),
  62. 'accessSecret' => env('OSS_ACCESS_SECRET'),
  63. 'bucket' => env('OSS_BUCKET'),
  64. 'endpoint' => env('OSS_ENDPOINT'),
  65. // 'timeout' => 3600,
  66. // 'connectTimeout' => 10,
  67. // 'isCName' => false,
  68. // 'token' => '',
  69. ],
  70. 'qiniu' => [
  71. 'driver' => \Hyperf\Filesystem\Adapter\QiniuAdapterFactory::class,
  72. 'accessKey' => env('QINIU_ACCESS_KEY'),
  73. 'secretKey' => env('QINIU_SECRET_KEY'),
  74. 'bucket' => env('QINIU_BUCKET'),
  75. 'domain' => env('QINBIU_DOMAIN'),
  76. ],
  77. 'cos' => [
  78. 'driver' => \Hyperf\Filesystem\Adapter\CosAdapterFactory::class,
  79. 'region' => env('COS_REGION'),
  80. 'credentials' => [
  81. 'appId' => env('COS_APPID'),
  82. 'secretId' => env('COS_SECRET_ID'),
  83. 'secretKey' => env('COS_SECRET_KEY'),
  84. ],
  85. 'bucket' => env('COS_BUCKET'),
  86. 'read_from_cdn' => false,
  87. // 'timeout' => 60,
  88. // 'connect_timeout' => 60,
  89. // 'cdn' => '',
  90. // 'scheme' => 'https',
  91. ],
  92. ],
  93. ];