main.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. $mainConfig = require_once __DIR__ . '/config.php';
  3. return [
  4. 'language' => 'zh-CN',
  5. 'timeZone' => 'PRC',
  6. 'aliases' => [
  7. '@bower' => '@vendor/bower-asset',
  8. '@npm' => '@vendor/npm-asset',
  9. ],
  10. 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
  11. 'components' => [
  12. 'db' => array_merge([
  13. 'class' => 'yii\db\Connection',
  14. 'enableSlaves' => false,
  15. ], $mainConfig['db'], $mainConfig['slavesDb']),
  16. 'dbLog' => array_merge(['class' => 'yii\mongodb\Connection',], $mainConfig['dbLog']),
  17. 'dbCalc' => array_merge(['class' => 'yii\db\Connection'], $mainConfig['dbCalc']),
  18. 'dbNetPoint' => array_merge(['class' => 'yii\db\Connection'], $mainConfig['dbNetPoint']),
  19. 'cache' => [
  20. 'class' => 'yii\redis\Cache',
  21. 'redis' => [
  22. 'hostname' => '127.0.0.1',
  23. 'port' => 6379,
  24. 'database' => 0,
  25. ]
  26. ],
  27. 'tokenRedis' => array_merge(['class' => 'yii\redis\Connection'], $mainConfig['tokenRedis']),
  28. 'redis' => array_merge(['class' => 'yii\redis\Connection'], $mainConfig['otherRedis']),
  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. 'swooleAsyncTimer' => [
  38. 'class' => 'common\components\SwooleAsyncTimer',
  39. ],
  40. ],
  41. 'controllerMap' => [
  42. 'swoole_server' => [
  43. 'class' => 'anlity\swooleAsyncTimer\SwooleAsyncTimerController',
  44. ],
  45. ],
  46. ];