main.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php
  2. // 根据运行环境加载不同的配置文件
  3. $mainConfig = require_once __DIR__ . '/config-product.php';
  4. return [
  5. 'language' => 'zh-CN', // zh-CN 目标语言
  6. 'sourceLanguage' => 'en-US',
  7. 'timeZone' => 'Africa/Lagos',
  8. 'aliases' => [
  9. '@bower' => '@vendor/bower-asset',
  10. '@npm' => '@vendor/npm-asset',
  11. ],
  12. 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
  13. 'components' => [
  14. 'db' => array_merge([
  15. 'class' => 'yii\db\Connection',
  16. 'enableSlaves' => false,
  17. ], $mainConfig['db'], $mainConfig['slavesDb']),
  18. 'dbLog' => array_merge(['class' => 'yii\mongodb\Connection',], $mainConfig['dbLog']),
  19. 'dbCalc' => array_merge(['class' => 'yii\db\Connection'], $mainConfig['dbCalc']),
  20. 'dbCalcServer' => array_merge(['class' => 'yii\db\Connection'], $mainConfig['dbCalcServer']),
  21. 'dbNetPoint' => array_merge(['class' => 'yii\db\Connection'], $mainConfig['dbNetPoint']),
  22. 'cache' => [
  23. 'class' => 'yii\redis\Cache',
  24. 'redis' => $mainConfig['cacheRedis'],
  25. ],
  26. 'tokenRedis' => array_merge(['class' => 'yii\redis\Connection'], $mainConfig['tokenRedis']),
  27. 'redis' => array_merge(['class' => 'yii\redis\Connection'], $mainConfig['otherRedis']),
  28. 'mailer' => [
  29. 'class' => 'yii\swiftmailer\Mailer',
  30. 'viewPath' => '@common/mail',
  31. 'useFileTransport' => false,
  32. 'enableSwiftMailerLogging' => true,
  33. 'transport' => [
  34. 'class' => 'Swift_SmtpTransport',
  35. 'host' => 'mail.authsmtp.com',
  36. 'port' => 325,
  37. 'username' => 'ac71555',
  38. 'password' => 'I1j-MKi-fJ8-nHb',
  39. 'encryption' => 'TLS',
  40. ],
  41. ],
  42. 'swooleAsyncTimer' => [
  43. 'class' => 'common\components\SwooleAsyncTimer',
  44. ],
  45. 'Paystack' => [
  46. 'class' => 'smladeoye\paystack\Paystack',
  47. 'environment' => YII_ENV,
  48. 'testPublicKey' => 'pk_test_2eed10135c4a958c5073795b22854ded9d1a6c55',
  49. 'testSecretKey' => 'sk_test_5ece72377432376f5cf6bb5c468395a650220309',
  50. 'livePublicKey' => 'pk_live_fae524f9d073d877beeb661fd825a37a9bc91f0a',
  51. 'liveSecretKey' => 'sk_live_b93c6bbee2cc0e9c594547bf4779ec9852b9d055',
  52. ],
  53. 'log' => [
  54. 'traceLevel' => YII_DEBUG ? 3 : 0,
  55. 'targets' => [
  56. [
  57. 'class' => 'yii\log\FileTarget',
  58. 'levels' => ['error', 'warning', 'info'],
  59. 'categories' => ['yii\db\*', 'app\models\*'],
  60. 'logFile' => '@runtime/logs/sql.log',
  61. ],
  62. 'db' => [ 'class' => 'yii\log\FileTarget'],
  63. ],
  64. ],
  65. 'i18n' => [
  66. 'translations' => [
  67. 'app*' => [
  68. 'class' => 'yii\i18n\PhpMessageSource',
  69. 'basePath' => '@common/messages',
  70. 'sourceLanguage' => 'en-US',
  71. 'fileMap' => [
  72. 'app' => 'app.php',
  73. 'app/error' => 'error.php',
  74. ],
  75. 'forceTranslation' => true,
  76. ],
  77. 'ctx*' => [
  78. 'class' => 'yii\i18n\PhpMessageSource',
  79. 'basePath' => '@common/messages',
  80. 'sourceLanguage' => 'en-US',
  81. 'fileMap' => [
  82. 'ctx' => 'ctx.php',
  83. 'ctx/error' => 'error.php',
  84. ],
  85. 'forceTranslation' => true,
  86. ],
  87. ],
  88. ],
  89. 'SilverStreet' => [
  90. 'class' => 'common\components\SilverStreet',
  91. 'username' => 'Elken',
  92. 'password' => 'MLgmmZ7s',
  93. 'sender' => 'Elken',
  94. 'apiUrl' => 'https://api.silverstreet.com/send.php',
  95. ],
  96. ],
  97. 'controllerMap' => [
  98. 'swoole_server' => [
  99. 'class' => 'anlity\swooleAsyncTimer\SwooleAsyncTimerController',
  100. ],
  101. ],
  102. ];