main-local.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. $config = [
  3. 'components' => [
  4. 'db' => [
  5. 'class' => 'yii\db\Connection',
  6. 'dsn' => env('DB_DSN'),
  7. 'username' => env('DB_USERNAME'),
  8. 'password' => env('DB_PASSWORD'),
  9. 'charset' => 'utf8',
  10. 'tablePrefix' => env('DB_TABLE_PREFIX'),
  11. 'enableSchemaCache' => YII_ENV_PROD,
  12. ],
  13. 'redis' => [
  14. 'class' => 'yii\redis\Connection',
  15. 'hostname' => env('REDIS_HOST', '127.0.0.1'),
  16. 'port' => env('REDIS_PORT', 6379),
  17. 'password' => env('REDIS_PASSWORD', null),
  18. 'database' => 0,
  19. ],
  20. 'mailer' => [
  21. 'class' => 'yii\swiftmailer\Mailer',
  22. 'viewPath' => '@common/mail',
  23. 'messageConfig' => [
  24. 'charset' => 'UTF-8',
  25. 'from' => env('MAIL_USERNAME')
  26. ],
  27. // send all mails to a file by default. You have to set
  28. // 'useFileTransport' to false and configure a transport
  29. // for the mailer to send real emails.
  30. 'useFileTransport' => false,
  31. 'transport' => [
  32. 'class' => 'Swift_SmtpTransport',
  33. 'host' => env('MAIL_HOST'),
  34. 'username' => env('MAIL_USERNAME'),
  35. 'password' => env('MAIL_PASSWORD'),
  36. 'port' => env('MAIL_PORT'),
  37. 'encryption' => env('MAIL_ENCRYPTION')
  38. ],
  39. ],
  40. 'xunsearch' => [
  41. 'class' => 'hightman\xunsearch\Connection',
  42. 'iniDirectory' => '@common/config', // 搜索 ini 文件目录,默认:@vendor/hightman/xunsearch/app
  43. 'charset' => 'utf-8', // 指定项目使用的默认编码,默认即时 utf-8,可不指定
  44. ]
  45. ],
  46. ];
  47. return $config;