|
|
@@ -1,102 +1,102 @@
|
|
|
<?php
|
|
|
return [
|
|
|
- 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
|
|
|
- 'components' => [
|
|
|
- 'cache' => [
|
|
|
- 'class' => 'yii\caching\FileCache',
|
|
|
- ],
|
|
|
- 'db' => [
|
|
|
- 'class' => 'yii\db\Connection',
|
|
|
- 'dsn' => 'mysql:host=127.0.0.1;dbname=huahuibao',
|
|
|
- 'username' => 'root',
|
|
|
- 'password' => 'zt20152008',
|
|
|
- 'charset' => 'utf8',
|
|
|
- ],
|
|
|
- 'redis' => [
|
|
|
- 'class' => 'yii\redis\Connection',
|
|
|
- 'hostname' => '127.0.0.1',
|
|
|
- 'port' => 6379,
|
|
|
- 'database' => 0,
|
|
|
- 'password'=>'byt6gc1w0aed2q7h',
|
|
|
- ],
|
|
|
- //redis发布与订阅
|
|
|
- 'redisPubSub'=>[
|
|
|
- 'class' => 'hollisho\redis_pub_sub\RedisPubSub',
|
|
|
- 'connect' => [
|
|
|
- 'class' => 'yii\redis\Connection',
|
|
|
- 'hostname' => '127.0.0.1',
|
|
|
- 'port' => 6379,
|
|
|
- 'database' => 0,
|
|
|
- 'password' => 'byt6gc1w0aed2q7h',
|
|
|
- 'connectionTimeout' => 20,
|
|
|
- ]
|
|
|
- ],
|
|
|
- 'dict' => [
|
|
|
- 'class' => 'common\components\configDict',
|
|
|
+ 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
|
|
|
+ 'components' => [
|
|
|
+ 'cache' => [
|
|
|
+ 'class' => 'yii\caching\FileCache',
|
|
|
],
|
|
|
- 'rabbitmq' => [
|
|
|
- 'class' => 'mikemadisonweb\rabbitmq\Configuration',
|
|
|
- 'connections' => [
|
|
|
- [
|
|
|
- 'host' => '127.0.0.1',
|
|
|
- 'port' => '5672',
|
|
|
- 'user' => 'admin',
|
|
|
- 'password' => 'vn3oaz1i8w32k4mm9',
|
|
|
- 'vhost' => '/',
|
|
|
- ]
|
|
|
- ],
|
|
|
- 'exchanges' => [
|
|
|
- [
|
|
|
- 'name' => 'ex1',
|
|
|
- 'type' => 'direct'
|
|
|
- ],
|
|
|
- ],
|
|
|
- 'queues' => [
|
|
|
- [
|
|
|
- 'name' => 'queues1',
|
|
|
- 'passive' => false,
|
|
|
- ],
|
|
|
- [
|
|
|
- 'name' => 'queues2',
|
|
|
- 'passive' => false,
|
|
|
- ],
|
|
|
- ],
|
|
|
- 'bindings' => [
|
|
|
- [
|
|
|
- 'queue' => 'queues1',
|
|
|
- 'exchange' => 'ex1',
|
|
|
- 'routing_keys' => ['route1'],
|
|
|
- ],
|
|
|
- ],
|
|
|
- 'producers' => [
|
|
|
- [
|
|
|
- 'name' => 'producers',
|
|
|
- ],
|
|
|
- ],
|
|
|
- 'consumers' => [
|
|
|
- [
|
|
|
- 'name' => 'consumers',
|
|
|
- 'callbacks' => [
|
|
|
- 'queues1' => '\common\components\rabbitmq\ImportDataConsumer',
|
|
|
- ],
|
|
|
- ],
|
|
|
- ],
|
|
|
- ],
|
|
|
- 'mailer' => [
|
|
|
- 'class' => 'yii\swiftmailer\Mailer',
|
|
|
- 'useFileTransport' =>false,//false发送邮件,true只是生成邮件在runtime文件夹下,不发邮件
|
|
|
- 'transport' => [
|
|
|
- 'class' => 'Swift_SmtpTransport',
|
|
|
- 'host' => 'smtp.126.com', //每种邮箱的host配置不一样
|
|
|
- 'username' => 'zhhinc@126.com',
|
|
|
- 'password' => '',
|
|
|
- 'port' => '25',
|
|
|
- 'encryption' => 'tls',
|
|
|
- ],
|
|
|
- 'messageConfig'=>[
|
|
|
- 'charset'=>'UTF-8',
|
|
|
- 'from'=>['zhhinc@126.com'=>'系统邮件']
|
|
|
- ],
|
|
|
- ],
|
|
|
- ],
|
|
|
+ 'db' => [
|
|
|
+ 'class' => 'yii\db\Connection',
|
|
|
+ 'dsn' => 'mysql:host=127.0.0.1;dbname=huahuibao',
|
|
|
+ 'username' => 'root',
|
|
|
+ 'password' => 'zt20152008',
|
|
|
+ 'charset' => 'utf8',
|
|
|
+ ],
|
|
|
+ 'redis' => [
|
|
|
+ 'class' => 'yii\redis\Connection',
|
|
|
+ 'hostname' => '127.0.0.1',
|
|
|
+ 'port' => 6379,
|
|
|
+ 'database' => 0,
|
|
|
+ 'password' => 'byt6gc1w0aed2q7h',
|
|
|
+ ],
|
|
|
+ //redis发布与订阅
|
|
|
+ 'redisPubSub' => [
|
|
|
+ 'class' => 'hollisho\redis_pub_sub\RedisPubSub',
|
|
|
+ 'connect' => [
|
|
|
+ 'class' => 'yii\redis\Connection',
|
|
|
+ 'hostname' => '127.0.0.1',
|
|
|
+ 'port' => 6379,
|
|
|
+ 'database' => 0,
|
|
|
+ 'password' => 'byt6gc1w0aed2q7h',
|
|
|
+ 'connectionTimeout' => 20,
|
|
|
+ ]
|
|
|
+ ],
|
|
|
+ 'dict' => [
|
|
|
+ 'class' => 'common\components\configDict',
|
|
|
+ ],
|
|
|
+ 'rabbitmq' => [
|
|
|
+ 'class' => 'mikemadisonweb\rabbitmq\Configuration',
|
|
|
+ 'connections' => [
|
|
|
+ [
|
|
|
+ 'host' => '127.0.0.1',
|
|
|
+ 'port' => '5672',
|
|
|
+ 'user' => 'admin',
|
|
|
+ 'password' => 'vn3oaz1i8w32k4mm9',
|
|
|
+ 'vhost' => '/',
|
|
|
+ ]
|
|
|
+ ],
|
|
|
+ 'exchanges' => [
|
|
|
+ [
|
|
|
+ 'name' => 'ex1',
|
|
|
+ 'type' => 'direct'
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ 'queues' => [
|
|
|
+ [
|
|
|
+ 'name' => 'queues1',
|
|
|
+ 'passive' => false,
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ 'name' => 'queues2',
|
|
|
+ 'passive' => false,
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ 'bindings' => [
|
|
|
+ [
|
|
|
+ 'queue' => 'queues1',
|
|
|
+ 'exchange' => 'ex1',
|
|
|
+ 'routing_keys' => ['route1'],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ 'producers' => [
|
|
|
+ [
|
|
|
+ 'name' => 'producers',
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ 'consumers' => [
|
|
|
+ [
|
|
|
+ 'name' => 'consumers',
|
|
|
+ 'callbacks' => [
|
|
|
+ 'queues1' => '\common\components\rabbitmq\ImportDataConsumer',
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ 'mailer' => [
|
|
|
+ 'class' => 'yii\swiftmailer\Mailer',
|
|
|
+ 'useFileTransport' => false,
|
|
|
+ 'transport' => [
|
|
|
+ 'class' => 'Swift_SmtpTransport',
|
|
|
+ 'host' => 'smtp.126.com',
|
|
|
+ 'username' => 'zhhinc@126.com',
|
|
|
+ 'password' => '',
|
|
|
+ 'port' => '25',
|
|
|
+ 'encryption' => 'tls',
|
|
|
+ ],
|
|
|
+ 'messageConfig' => [
|
|
|
+ 'charset' => 'UTF-8',
|
|
|
+ 'from' => ['zhhinc@126.com' => '系统邮件']
|
|
|
+ ],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
];
|