main.php 2.2 KB

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