main.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. // 'anlity/swooleAsyncTimer' => '@backend/runtime/tmp-extensions/yii2-swoole-async-timer',
  10. ],
  11. 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
  12. 'components' => [
  13. 'db' => array_merge([
  14. 'class' => 'yii\db\Connection',
  15. 'enableSlaves' => false,
  16. // 'enableSavepoint' => false,
  17. ], $mainConfig['db'], $mainConfig['slavesDb']),
  18. // 'dbShop' => array_merge(['class' => 'yii\db\Connection', 'schemaMap' => ['oci' => 'common\helpers\Schema']], $mainConfig['dbShop']),
  19. 'dbLog' => array_merge(['class' => 'yii\mongodb\Connection',], $mainConfig['dbLog']),
  20. 'dbCalc' => array_merge(['class' => 'yii\db\Connection'], $mainConfig['dbCalc']),
  21. // 'dbShopCalc' => array_merge(['class' => 'yii\db\Connection', 'schemaMap' => ['oci' => 'common\helpers\Schema'],], $mainConfig['dbShopCalc']),
  22. 'dbNetPoint' => array_merge(['class' => 'yii\db\Connection'], $mainConfig['dbNetPoint']),
  23. // 'cache' => [
  24. // //'class' => 'yii\caching\FileCache',
  25. // //'class' => 'dcb9\redis\Cache',
  26. // 'class' => \yii\redis\Cache::class,
  27. // 'redis' => $mainConfig['cacheRedis'],
  28. // ],
  29. 'cache' => [
  30. 'class' => 'yii\redis\Cache',
  31. //'redis' => $mainConfig['cacheRedis'],
  32. 'redis' => [
  33. 'hostname' => '172.18.0.3',
  34. 'port' => 6379,
  35. 'database' => 0,
  36. ]
  37. ],
  38. 'tokenRedis' => array_merge(['class' => \yii\redis\Cache::class], $mainConfig['tokenRedis']),
  39. 'redis' => array_merge(['class' => \yii\redis\Cache::class], $mainConfig['otherRedis']),
  40. // 'tokenRedis' => array_merge(['class' => \yii\redis\Cache::class], $mainConfig['tokenRedis']),
  41. // 'redis' => array_merge(['class' => \yii\redis\Cache::class], $mainConfig['otherRedis']),
  42. 'mailer' => [
  43. 'class' => 'yii\swiftmailer\Mailer',
  44. 'viewPath' => '@common/mail',
  45. // send all mails to a file by default. You have to set
  46. // 'useFileTransport' to false and configure a transport
  47. // for the mailer to send real emails.
  48. 'useFileTransport' => true,
  49. ],
  50. 'swooleAsyncTimer' => [
  51. 'class' => 'common\components\SwooleAsyncTimer',
  52. ],
  53. ],
  54. 'controllerMap' => [
  55. 'swoole_server' => [
  56. 'class' => 'anlity\swooleAsyncTimer\SwooleAsyncTimerController',
  57. ],
  58. ],
  59. ];