main-local.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. return [
  3. 'components' => [
  4. 'db' => [
  5. 'class' => 'common\replaces\db\Connection',
  6. 'enableSavepoint' => false,
  7. 'tablePrefix' => 'qimall_',
  8. 'commandMap' => [
  9. 'mysql' => 'common\replaces\Command'
  10. ],
  11. 'dsn' => 'mysql:host=mysql_db;port=3306;dbname=qimall',
  12. 'username' => 'root',
  13. 'password' => '---mysql_password---',
  14. 'charset' => 'utf8mb4',
  15. ],
  16. 'redis' => [
  17. 'class' => 'yii\redis\Connection',
  18. 'hostname' => 'redis_db',
  19. 'port' => 6379,
  20. 'password' => '---redis_password---',
  21. 'retries' => 3,
  22. 'database' => 0,
  23. 'connectionTimeout' => 5,
  24. ],
  25. 'cache' => [
  26. 'class' => 'yii\redis\Cache',
  27. 'keyPrefix' => 'qimallCache:', // 唯一键前缀
  28. ],
  29. 'mailer' => [
  30. 'class' => 'yii\swiftmailer\Mailer',
  31. 'viewPath' => '@common/mail',
  32. // send all mails to a file by default. You have to set
  33. // 'useFileTransport' to false and configure a transport
  34. // for the mailer to send real emails.
  35. 'useFileTransport' => true,
  36. ],
  37. 'elasticsearch' => [
  38. 'class' => 'yii\elasticsearch\Connection',
  39. 'nodes' => [
  40. ['http_address' => 'es:9200'],
  41. ],
  42. 'autodetectCluster' => false,
  43. ],
  44. 'rabbitMq' =>[
  45. 'class' => app\component\lib\RabbitClient::class,
  46. 'host' => 'rabbitmq',
  47. 'port' => 5672,
  48. 'userName' => 'admin',
  49. 'passWord' => '---rabbitmq_password---',
  50. 'setting' => [
  51. 'vhost' => '/',
  52. 'insist' => false,
  53. 'login_method'=>'AMQPLAIN',
  54. 'login_response'=>null,
  55. 'locale'=>'en_US',
  56. 'connection_timeout'=>60,
  57. 'read_write_timeout'=>60,
  58. 'context'=>null,
  59. 'keepalive'=>false,
  60. 'heartbeat'=>30
  61. ]
  62. ],
  63. ],
  64. ];