discuz!q官方教程之配置信息

[复制链接]
查看3591 | 回复0 | 2020-7-4 09:07 | 显示全部楼层 |阅读模式
discuz!q官方教程之配置信息
  1. <?php

  2. return [
  3.     'debug' => true,
  4.     'locale' => 'zh-CN',
  5.     'fallback_locale' => 'zh-CN',
  6.     'timezone' => 'Asia/Shanghai',
  7.     'key' => 'base64:JtNRiS14Mopb+HNi3ztxi6259im9DTDBJXOzLDbcquw=',
  8.     'cipher' => 'AES-256-CBC',
  9.     'site_url' => 'DummySiteUrl',
  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.             'options' => extension_loaded('pdo_mysql') ? array_filter([
  24.                 PDO::MYSQL_ATTR_SSL_CA => '',
  25.             ]) : [],
  26.         ],
  27.     'redis' => [
  28.         'client' => 'phpredis',

  29.         'options' => [
  30.             'cluster' => 'redis',
  31.             'prefix' => Str::slug('discuz', '_').'_database_'
  32.         ],

  33.         'default' => [
  34.             'url' => '',
  35.             'host' => '127.0.0.1',
  36.             'password' => '123',
  37.             'port' => 6379,
  38.             'database' => 0
  39.         ],

  40.         'cache' => [
  41.             'url' => '',
  42.             'host' => '127.0.0.1',
  43.             'password' => '123',
  44.             'port' => 6379,
  45.             'database' => 1
  46.         ],
  47.     ],
  48.     //缓存系统配置
  49.     'cache' => [
  50.         'default' => 'file', //如果配置的 redis 可用, 会自动切换为redis

  51.         'stores' => [
  52.             'file' => [
  53.                 'driver' => 'file',
  54.                 'path' => storage_path('cache/data'),
  55.             ],
  56.             'redis' => [
  57.                 'driver' => 'redis',
  58.                 'connection' => 'cache',
  59.             ],
  60.         ],

  61.         'prefix' => 'discuz_cache',

  62.     ],
  63.     //文件系统配置
  64.     'filesystems' => [
  65.         'default' => 'local',
  66.         'cloud' => '',
  67.         'disks' => [
  68.             'local' => [
  69.                 'driver' => 'local',
  70.                 'root' => storage_path('app'),
  71.             ],
  72.             'public' => [
  73.                 'driver' => 'local',
  74.                 'root' => storage_path('app/public'),
  75.                 'url' => 'public',
  76.                 'visibility' => 'public',
  77.             ],
  78.             'avatar' => [
  79.                 'driver' => 'local',
  80.                 'root' => storage_path('app/public/avatars'),
  81.                 'url' => 'avatar',
  82.                 'visibility' => 'public',
  83.             ],
  84.             'attachment' => [
  85.                 'driver' => 'local',
  86.                 'root'   => storage_path('app/public/attachment'),
  87.                 'url'    => 'attachment'
  88.             ],
  89.             'cos' => [
  90.                 'driver' => 'cos',
  91.                 'region' => 'ap-beijing', //设置一个默认的存储桶地域
  92.                 'schema' => 'https', //协议头部,默认为http
  93.                 'bucket' => 'test-1251011534',
  94.                 'read_from_cdn' => false, //是否从cdn读取,如果为true , 设置cdn地址
  95.                 'credentials'=> [
  96.                     'secretId'  => 'COS_SECRETID',  //"云 API 密钥 SecretId";
  97.                     'secretKey' => 'COS_SECRETKEY', //"云 API 密钥 SecretKey";
  98.                     'token' => 'token' //"临时密钥 token";
  99.                 ]
  100.             ]
  101.         ]
  102.     ],
  103.     'queue' => [
  104.         'default' => 'redis',
  105.         'connections' => [
  106.             'redis' => [
  107.                 'driver' => 'redis',
  108.                 'connection' => 'default',
  109.                 'queue' => 'REDIS_QUEUE',
  110.                 'retry_after' => 90,
  111.                 'block_for' => null,
  112.             ]
  113.         ]
  114.     ],
  115.     'excel' => [
  116.         'root' => storage_path('public/exports')
  117.     ],
  118.     //加载ServiceProvider
  119.     'providers' => [
  120.         App\Formatter\FormatterServiceProvider::class,
  121.         App\Providers\EventServiceProvider::class,
  122.         App\Providers\SettingsServiceProvider::class,
  123.         App\Providers\CategoryServiceProvider::class,
  124.         App\Providers\UserServiceProvider::class,
  125.         App\Providers\ThreadServiceProvider::class,
  126.         App\Providers\PostServiceProvider::class,
  127.         App\Providers\OrderServiceProvider::class,
  128.         App\Providers\UserWalletLogsServiceProvider::class,
  129.         App\Providers\UserWalletCashServiceProvider::class,
  130.         App\Providers\UserWalletServiceProvider::class,
  131.     ],
  132.     'sms' => [
  133.         // HTTP 请求的超时时间(秒)
  134.         'timeout' => 5.0,

  135.         // 默认发送配置
  136.         'default' => [
  137.             // 网关调用策略,默认:顺序调用
  138.             'strategy' => Overtrue\EasySms\Strategies\OrderStrategy::class,

  139.             // 默认可用的发送网关
  140.             'gateways' => [
  141.                 'qcloud'
  142.             ],
  143.         ],
  144.         // 可用的网关配置
  145.         'gateways' => [
  146.             'errorlog' => [
  147.                 'file' => storage_path('log/easy-sms.log')
  148.             ],
  149.             'qcloud' => [
  150.                 'sdk_app_id' => 'xxx', // SDK APP ID
  151.                 'app_key' => 'xxxx', // APP KEY
  152.                 'sign_name' => 'xxx', // 短信签名,如果使用默认签名,该字段可缺省(对应官方文档中的sign)
  153.             ],
  154.         ],
  155.     ]
  156. ];
复制代码

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

UID
1
贡献
387
丢币
38902
主题
4607
回帖
116
注册时间
2018-9-25
最后登录
2024-4-16