0
0

main.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. $params = array_merge(
  3. require __DIR__ . '/../../common/config/params.php',
  4. require __DIR__ . '/../../common/config/params-local.php',
  5. require __DIR__ . '/params.php',
  6. require __DIR__ . '/params-local.php'
  7. );
  8. return [
  9. 'id' => 'app-backend',
  10. 'basePath' => dirname(__DIR__),
  11. 'controllerNamespace' => 'backend\controllers',
  12. 'bootstrap' => ['log'],
  13. 'modules' => [],
  14. 'components' => [
  15. 'request' => [
  16. 'baseUrl' => '',
  17. 'enableCsrfValidation' => false,
  18. 'parsers' => [
  19. 'application/json' => 'yii\web\JsonParser'
  20. ]
  21. ],
  22. 'user' => [
  23. 'identityClass' => 'common\models\User',
  24. 'enableAutoLogin' => true,
  25. 'identityCookie' => ['name' => '_identity-backend', 'httpOnly' => true],
  26. ],
  27. 'session' => [
  28. // this is the name of the session cookie used for login on the backend
  29. 'name' => 'advanced-backend',
  30. ],
  31. 'log' => [
  32. 'traceLevel' => YII_DEBUG ? 3 : 0,
  33. 'targets' => [
  34. [
  35. 'class' => 'yii\log\FileTarget',
  36. 'levels' => ['error', 'warning'],
  37. ],
  38. ],
  39. ],
  40. 'errorHandler' => [
  41. 'class' => 'components\ErrorHandler',
  42. 'errorAction' => 'site/error',
  43. ],
  44. 'db' => require __DIR__ . '/../../common/config/db.php',
  45. 'urlManager' => [
  46. 'enablePrettyUrl' => true,
  47. 'enableStrictParsing' => false,
  48. 'showScriptName' => false,
  49. 'rules' => [
  50. ],
  51. ]
  52. ],
  53. 'params' => $params,
  54. ];