You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.8 KiB

  1. <?php
  2. $params = array_merge(
  3. require __DIR__ . '/../../common/config/params.php', require __DIR__ . '/../../common/config/params-local.php', require __DIR__ . '/params.php', require __DIR__ . '/params-local.php'
  4. );
  5. return [
  6. 'id' => 'backend',
  7. 'basePath' => dirname(__DIR__),
  8. 'controllerNamespace' => 'backend\controllers',
  9. 'bootstrap' => ['log'],
  10. 'modules' => [
  11. 'goods' => [
  12. 'class' => '\backend\modules\goods\Module',
  13. ],
  14. 'file' => [
  15. 'class' => '\backend\modules\file\Module',
  16. ],
  17. 'shop' => [
  18. 'class' => '\backend\modules\shop\Module',
  19. ],
  20. 'wx-public-account' => [
  21. 'class' => '\backend\modules\wx_public_account\Module',
  22. ],
  23. ],
  24. 'components' => [
  25. 'request' => [
  26. 'parsers' => [
  27. 'application/json' => 'yii\web\JsonParser',
  28. ],
  29. 'csrfParam' => '_csrf-api',
  30. ],
  31. 'user' => [
  32. 'identityClass' => 'common\models\User',
  33. 'enableAutoLogin' => true,
  34. 'identityCookie' => ['name' => '_identity-backend', 'httpOnly' => true],
  35. ],
  36. 'session' => [
  37. // this is the name of the session cookie used for login on the app
  38. 'name' => 'backend',
  39. ],
  40. 'log' => [
  41. 'traceLevel' => YII_DEBUG ? 3 : 0,
  42. 'targets' => [
  43. [
  44. 'class' => 'yii\log\FileTarget',
  45. 'levels' => ['error', 'warning'],
  46. ],
  47. [
  48. 'class' => 'yii\log\FileTarget',
  49. 'levels' => ['info', 'error'],
  50. 'categories' => ['imagetest'],
  51. 'logFile' => '@app/runtime/logs/imagetest.log',
  52. 'logVars' => [],
  53. 'exportInterval' => 1,
  54. 'prefix' => function ($message) {
  55. }
  56. ],
  57. [
  58. 'class' => 'yii\log\FileTarget',
  59. 'levels' => ['error', 'warning'],
  60. 'categories' => ['refund_log'],
  61. 'logFile' => '@app/runtime/logs/refund_log.log',
  62. 'logVars' => [],
  63. 'exportInterval' => 1,
  64. 'prefix' => function ($message) {
  65. }
  66. ],
  67. ],
  68. ],
  69. 'errorHandler' => [
  70. 'errorAction' => 'site/error',
  71. ],
  72. 'urlManager' => [
  73. 'enablePrettyUrl' => true,
  74. 'showScriptName' => false,
  75. 'rules' => [
  76. ],
  77. ],
  78. 'file' => ['class' => 'backend\logic\file\FileManager'],
  79. 'goods' => ['class' => 'goods\goods\logic\goods\GoodsManager'],
  80. ],
  81. // 'as access' => [
  82. // 'class' => 'iron\components\AccessControl',
  83. // ],
  84. 'params' => $params,
  85. ];