配置信息

  1. <?php
  2. use Illuminate\Support\Str;
  3. return [
  4. 'debug' => false,
  5. 'locale' => 'zh-CN',
  6. 'fallback_locale' => 'zh-CN',
  7. 'timezone' => 'Asia/Shanghai',
  8. 'key' => 'base64:JtNRiS14Mopb+HNi3ztxi6259im9DTDBJXOzLDbcquw=',
  9. 'cipher' => 'AES-256-CBC',
  10. 'database' =>
  11. [
  12. 'driver' => 'mysql',
  13. 'host' => 'DummyDbHost',
  14. 'port' => 'DummyDbPort',
  15. 'database' => 'DummyDbDatabase',
  16. 'username' => 'DummyDbUsername',
  17. 'password' => 'DummyDbPassword',
  18. 'charset' => 'utf8mb4',
  19. 'collation' => 'utf8mb4_unicode_ci',
  20. 'prefix' => 'DummyDbPrefix',
  21. 'prefix_indexes' => true,
  22. 'strict' => true,
  23. 'engine' => 'InnoDB',
  24. 'options' => extension_loaded('pdo_mysql') ? array_filter([
  25. PDO::MYSQL_ATTR_SSL_CA => '',
  26. ]) : [],
  27. ],
  28. 'redis' => [
  29. 'client' => 'phpredis',
  30. 'options' => [
  31. 'cluster' => 'redis',
  32. 'prefix' => Str::slug('discuz', '_').'_database_'
  33. ],
  34. 'default' => [
  35. 'url' => '',
  36. 'host' => '127.0.0.1',
  37. 'password' => '',
  38. 'port' => 6379,
  39. 'database' => 0
  40. ],
  41. 'cache' => [
  42. 'url' => '',
  43. 'host' => '127.0.0.1',
  44. 'password' => '',
  45. 'port' => 6379,
  46. 'database' => 1
  47. ],
  48. ],
  49. //缓存系统配置
  50. 'cache' => [
  51. 'default' => 'file', //如果配置的 redis 可用, 会自动切换为redis
  52. 'stores' => [
  53. 'file' => [
  54. 'driver' => 'file',
  55. 'path' => storage_path('cache/data'),
  56. ],
  57. 'redis' => [
  58. 'driver' => 'redis',
  59. 'connection' => 'cache',
  60. ],
  61. ],
  62. 'prefix' => 'discuz_cache',
  63. ],
  64. //文件系统配置
  65. 'filesystems' => [
  66. 'default' => 'local',
  67. 'cloud' => '',
  68. 'disks' => [
  69. 'local' => [
  70. 'driver' => 'local',
  71. 'root' => storage_path('app'),
  72. ],
  73. 'public' => [
  74. 'driver' => 'local',
  75. 'root' => storage_path('app/public'),
  76. 'url' => 'public',
  77. 'visibility' => 'public',
  78. ],
  79. 'avatar' => [
  80. 'driver' => 'local',
  81. 'root' => storage_path('app/public/avatars'),
  82. 'url' => 'avatar',
  83. 'visibility' => 'public',
  84. ],
  85. 'avatar_cos' => [
  86. 'driver' => 'cos',
  87. 'root' => storage_path('app/public/avatars'),
  88. 'url' => 'avatar',
  89. 'visibility' => 'public',
  90. ],
  91. 'attachment' => [
  92. 'driver' => 'local',
  93. 'root' => storage_path('app'),
  94. 'url' => 'attachment'
  95. ],
  96. 'attachment_cos' => [
  97. 'driver' => 'cos',
  98. 'root' => storage_path('app/public/attachment'),
  99. 'url' => 'attachment'
  100. ],
  101. 'cos' => [
  102. 'driver' => 'cos',
  103. 'region' => '', //设置一个默认的存储桶地域
  104. 'schema' => 'https', //协议头部,默认为http
  105. 'bucket' => '',
  106. 'read_from_cdn' => false, //是否从cdn读取,如果为true , 设置cdn地址
  107. 'credentials'=> [
  108. 'secretId' => '', //"云 API 密钥 SecretId";
  109. 'secretKey' => '', //"云 API 密钥 SecretKey";
  110. 'token' => '' //"临时密钥 token";
  111. ]
  112. ]
  113. ]
  114. ],
  115. 'queue' => [
  116. 'default' => 'redis',
  117. 'connections' => [
  118. 'redis' => [
  119. 'driver' => 'redis',
  120. 'connection' => 'default',
  121. 'queue' => 'REDIS_QUEUE',
  122. 'retry_after' => 90,
  123. 'block_for' => null,
  124. ]
  125. ]
  126. ],
  127. 'excel' => [
  128. 'root' => storage_path('public/exports')
  129. ],
  130. //加载ServiceProvider
  131. 'providers' => [
  132. App\Formatter\FormatterServiceProvider::class,
  133. App\Passport\Oauth2ServiceProvider::class,
  134. App\Providers\AppServiceProvider::class,
  135. App\Providers\AttachmentServiceProvider::class,
  136. App\Providers\CategoryServiceProvider::class,
  137. App\Providers\EventServiceProvider::class,
  138. App\Providers\OrderServiceProvider::class,
  139. App\Providers\PostServiceProvider::class,
  140. App\Providers\SettingsServiceProvider::class,
  141. App\Providers\ThreadServiceProvider::class,
  142. App\Providers\UserServiceProvider::class,
  143. App\Providers\DialogMessageServiceProvider::class,
  144. ],
  145. 'sms' => [
  146. // HTTP 请求的超时时间(秒)
  147. 'timeout' => 5.0,
  148. // 默认发送配置
  149. 'default' => [
  150. // 网关调用策略,默认:顺序调用
  151. 'strategy' => Overtrue\EasySms\Strategies\OrderStrategy::class,
  152. // 默认可用的发送网关
  153. 'gateways' => [
  154. 'qcloud'
  155. ],
  156. ],
  157. // 可用的网关配置
  158. 'gateways' => [
  159. 'errorlog' => [
  160. 'file' => storage_path('log/easy-sms.log')
  161. ],
  162. 'qcloud' => [
  163. 'sdk_app_id' => '', // SDK APP ID
  164. 'app_key' => '', // APP KEY
  165. 'sign_name' => '', // 短信签名,如果使用默认签名,该字段可缺省(对应官方文档中的sign)
  166. ],
  167. ],
  168. ],
  169. 'cross' => [
  170. 'status' => true,//如果为true则在响应中加入headers
  171. 'headers' => [
  172. 'Access-Control-Allow-Origin' => [
  173. //设置允许跨域,默认包含本站site_url
  174. ],
  175. 'Access-Control-Allow-Headers' => 'Origin, Content-Type, Cookie, X-CSRF-TOKEN, Accept, Authorization, X-XSRF-TOKEN',
  176. 'Access-Control-Expose-Headers' => 'Authorization, authenticated',
  177. 'Access-Control-Allow-Methods' => 'GET, POST, PATCH, PUT, OPTIONS, DELETE',
  178. 'Access-Control-Allow-Credentials' => 'true'
  179. ]
  180. ]
  181. ];