main.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. $mainConfig = require_once __DIR__ . '/config.php';
  3. return [
  4. 'preparePerfLimit' => $configParams['preparePerfLimit'],
  5. 'language' => 'zh-CN',
  6. 'timeZone' => 'PRC',
  7. 'aliases' => [
  8. '@bower' => '@vendor/bower-asset',
  9. '@npm' => '@vendor/npm-asset',
  10. // 'anlity/swooleAsyncTimer' => '@backend/runtime/tmp-extensions/yii2-swoole-async-timer',
  11. ],
  12. 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
  13. 'components' => [
  14. 'db' => array_merge([
  15. 'class' => 'yii\db\Connection',
  16. 'enableSlaves' => false,
  17. // 'enableSavepoint' => false,
  18. ], $mainConfig['db'], $mainConfig['slavesDb']),
  19. // 'dbShop' => array_merge(['class' => 'yii\db\Connection', 'schemaMap' => ['oci' => 'common\helpers\Schema']], $mainConfig['dbShop']),
  20. 'dbLog' => array_merge(['class' => 'yii\mongodb\Connection',], $mainConfig['dbLog']),
  21. 'dbCalc' => array_merge(['class' => 'yii\db\Connection'], $mainConfig['dbCalc']),
  22. // 'dbShopCalc' => array_merge(['class' => 'yii\db\Connection', 'schemaMap' => ['oci' => 'common\helpers\Schema'],], $mainConfig['dbShopCalc']),
  23. 'dbNetPoint' => array_merge(['class' => 'yii\db\Connection'], $mainConfig['dbNetPoint']),
  24. // 'cache' => [
  25. // //'class' => 'yii\caching\FileCache',
  26. // 'class' => 'dcb9\redis\Cache',
  27. // 'redis' => $mainConfig['cacheRedis'],
  28. // ],
  29. 'cache' => [
  30. 'class' => 'yii\redis\Cache',
  31. 'redis' => $mainConfig['cacheRedis'],
  32. // 'redis' => [
  33. // 'hostname' => '127.0.0.1',
  34. // 'port' => 6379,
  35. // 'database' => 0,
  36. // ]
  37. ],
  38. 'tokenRedis' => array_merge(['class' => 'yii\redis\Connection'], $mainConfig['tokenRedis']),
  39. 'redis' => array_merge(['class' => 'yii\redis\Connection'], $mainConfig['otherRedis']),
  40. // 'tokenRedis' => array_merge(['class' => 'common\components\Redis'], $mainConfig['tokenRedis']),
  41. // 'redis' => array_merge(['class' => 'common\components\Redis'], $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. ];