main.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. 'log' => [
  14. 'targets' => [
  15. [
  16. 'class' => 'yii\log\FileTarget',
  17. 'levels' => ['error', 'warning', 'info'],
  18. 'categories' => ['yii\db\*', 'app\models\*'],
  19. 'logFile' => '@runtime/logs/sql.log',
  20. ],
  21. 'db' => [ 'class' => 'yii\log\FileTarget'],
  22. ],
  23. ],
  24. 'db' => array_merge([
  25. 'class' => 'yii\db\Connection',
  26. 'enableSlaves' => false,
  27. // 'enableSavepoint' => false,
  28. ], $mainConfig['db'], $mainConfig['slavesDb']),
  29. // 'dbShop' => array_merge(['class' => 'yii\db\Connection', 'schemaMap' => ['oci' => 'common\helpers\Schema']], $mainConfig['dbShop']),
  30. 'dbLog' => array_merge(['class' => 'yii\mongodb\Connection',], $mainConfig['dbLog']),
  31. 'dbCalc' => array_merge(['class' => 'yii\db\Connection'], $mainConfig['dbCalc']),
  32. // 'dbShopCalc' => array_merge(['class' => 'yii\db\Connection', 'schemaMap' => ['oci' => 'common\helpers\Schema'],], $mainConfig['dbShopCalc']),
  33. 'dbNetPoint' => array_merge(['class' => 'yii\db\Connection'], $mainConfig['dbNetPoint']),
  34. // 'cache' => [
  35. // //'class' => 'yii\caching\FileCache',
  36. // 'class' => 'dcb9\redis\Cache',
  37. // 'redis' => $mainConfig['cacheRedis'],
  38. // ],
  39. 'cache' => [
  40. 'class' => 'yii\redis\Cache',
  41. 'redis' => $mainConfig['cacheRedis'],
  42. // 'redis' => [
  43. // 'hostname' => '127.0.0.1',
  44. // 'port' => 6379,
  45. // 'database' => 0,
  46. // ]
  47. ],
  48. 'tokenRedis' => array_merge(['class' => 'yii\redis\Connection'], $mainConfig['tokenRedis']),
  49. 'redis' => array_merge(['class' => 'yii\redis\Connection'], $mainConfig['otherRedis']),
  50. // 'tokenRedis' => array_merge(['class' => 'common\components\Redis'], $mainConfig['tokenRedis']),
  51. // 'redis' => array_merge(['class' => 'common\components\Redis'], $mainConfig['otherRedis']),
  52. 'mailer' => [
  53. 'class' => 'yii\swiftmailer\Mailer',
  54. 'viewPath' => '@common/mail',
  55. // send all mails to a file by default. You have to set
  56. // 'useFileTransport' to false and configure a transport
  57. // for the mailer to send real emails.
  58. 'useFileTransport' => true,
  59. ],
  60. 'swooleAsyncTimer' => [
  61. 'class' => 'common\components\SwooleAsyncTimer',
  62. ],
  63. // iPay88配置
  64. 'iPay88' => [
  65. 'class' => 'frontendApi\modules\v1\components\IPay88',
  66. 'merchantCode' => 'M08669', // 'M08669_S0002', // M08669(prod)
  67. 'merchantKey' => 'SiYF6a0QYy', // '5Mb154IrY8', // SiYF6a0QYy(prod)
  68. 'currencyCode' => 'MYR', //'CNY', // MYR(马来币) CNY(人民币)
  69. // 'responseUrl' => 'http://nc-fele-mips.elken.com:8016/return.html', // (test)
  70. // 'backendUrl' => 'http://nc-fapi-mips.elken.com:8013/pay.html', // (test)
  71. 'responseUrl' => 'https://fele.ncshop.elken.com/return.html', // (prod)
  72. 'backendUrl' => 'http://fapi.ncshop.elken.com/v1/shop/verify-approach-order', // (prod)
  73. 'requeryUrl' => 'https://payment.ipay88.com.my/epayment/enquiry.asp',
  74. 'paymentUrl' => 'https://payment.ipay88.com.my/epayment/entry.asp',
  75. 'recurringUrlSubscription' => 'https://www.ipay88.com/recurringpayment/webservice/RecurringPayment.asmx/Subscription',
  76. 'recurringUrlTermination' => 'https://www.ipay88.com/recurringpayment/webservice/RecurringPayment.asmx/Termination'
  77. ],
  78. ],
  79. 'controllerMap' => [
  80. 'swoole_server' => [
  81. 'class' => 'anlity\swooleAsyncTimer\SwooleAsyncTimerController',
  82. ],
  83. ],
  84. ];