main.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. return [
  3. 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
  4. 'components' => [
  5. 'cache' => [
  6. 'class' => 'yii\caching\FileCache',
  7. ],
  8. 'db' => [
  9. 'class' => 'yii\db\Connection',
  10. 'dsn' => 'mysql:host=127.0.0.1;dbname=huahuibao',
  11. 'username' => 'root',
  12. 'password' => 'zt20152008',
  13. 'charset' => 'utf8',
  14. ],
  15. 'redis' => [
  16. 'class' => 'yii\redis\Connection',
  17. 'hostname' => '127.0.0.1',
  18. 'port' => 6379,
  19. 'database' => 0,
  20. 'password' => 'byt6gc1w0aed2q7h',
  21. ],
  22. //redis发布与订阅
  23. 'redisPubSub' => [
  24. 'class' => 'hollisho\redis_pub_sub\RedisPubSub',
  25. 'connect' => [
  26. 'class' => 'yii\redis\Connection',
  27. 'hostname' => '127.0.0.1',
  28. 'port' => 6379,
  29. 'database' => 0,
  30. 'password' => 'byt6gc1w0aed2q7h',
  31. 'connectionTimeout' => 20,
  32. ]
  33. ],
  34. 'dict' => [
  35. 'class' => 'common\components\configDict',
  36. ],
  37. 'rabbitmq' => [
  38. 'class' => 'mikemadisonweb\rabbitmq\Configuration',
  39. 'connections' => [
  40. [
  41. 'host' => '127.0.0.1',
  42. 'port' => '5672',
  43. 'user' => 'admin',
  44. 'password' => 'vn3oaz1i8w32k4mm9',
  45. 'vhost' => '/',
  46. ]
  47. ],
  48. 'exchanges' => [
  49. [
  50. 'name' => 'ex1',
  51. 'type' => 'direct'
  52. ],
  53. ],
  54. 'queues' => [
  55. [
  56. 'name' => 'queues1',
  57. 'passive' => false,
  58. ],
  59. [
  60. 'name' => 'queues2',
  61. 'passive' => false,
  62. ],
  63. ],
  64. 'bindings' => [
  65. [
  66. 'queue' => 'queues1',
  67. 'exchange' => 'ex1',
  68. 'routing_keys' => ['route1'],
  69. ],
  70. ],
  71. 'producers' => [
  72. [
  73. 'name' => 'producers',
  74. ],
  75. ],
  76. 'consumers' => [
  77. [
  78. 'name' => 'consumers',
  79. 'callbacks' => [
  80. 'queues1' => '\common\components\rabbitmq\ImportDataConsumer',
  81. ],
  82. ],
  83. ],
  84. ],
  85. 'mailer' => [
  86. 'class' => 'yii\swiftmailer\Mailer',
  87. 'useFileTransport' => false,
  88. 'transport' => [
  89. 'class' => 'Swift_SmtpTransport',
  90. 'host' => 'smtp.126.com',
  91. 'username' => 'zhhinc@126.com',
  92. 'password' => '',
  93. 'port' => '25',
  94. 'encryption' => 'tls',
  95. ],
  96. 'messageConfig' => [
  97. 'charset' => 'UTF-8',
  98. 'from' => ['zhhinc@126.com' => '系统邮件']
  99. ],
  100. ],
  101. ],
  102. ];