main.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. return [
  3. 'aliases' => [
  4. '@bower' => '@vendor/bower-asset',
  5. '@npm' => '@vendor/npm-asset',
  6. ],
  7. 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
  8. 'bootstrap' => ['queue','queue2'],
  9. 'components' => [
  10. 'cache' => [
  11. 'class' => 'yii\caching\FileCache',
  12. 'cachePath'=>Yii::getAlias('@common').'/cachefile',
  13. 'keyPrefix'=>'ygf',
  14. ],
  15. 'redis' =>[
  16. 'class' => 'yii\redis\Connection',
  17. 'hostname' => '127.0.0.1', //你的redis地址
  18. 'port' => 6379, //端口
  19. 'database' => 0,
  20. ],
  21. 'queue' => [
  22. 'class' => \yii\queue\redis\Queue::class,
  23. 'redis' => 'redis', // 连接组件或它的配置
  24. 'as log' => \yii\queue\LogBehavior::class,
  25. 'channel' => 'queueyigou', // Queue channel key
  26. ],
  27. //报名邮件发送
  28. 'queue2' => [
  29. 'class' => \yii\queue\db\Queue::class,
  30. 'db' => 'db', // DB 连接组件或它的配置
  31. 'tableName' => '{{%common_queue}}', // 表名
  32. 'channel' => 'default', // Queue channel key
  33. 'mutex' => \yii\mutex\MysqlMutex::class,
  34. ],
  35. ],
  36. ];