0
0

main.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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-frontend',
  10. 'basePath' => dirname(__DIR__),
  11. 'bootstrap' => ['log'],
  12. 'controllerNamespace' => 'frontend\controllers',
  13. 'components' => [
  14. 'request' => [
  15. 'csrfParam' => '_csrf-frontend',
  16. ],
  17. 'user' => [
  18. 'identityClass' => 'common\models\User',
  19. 'enableAutoLogin' => true,
  20. 'identityCookie' => ['name' => '_identity-frontend', 'httpOnly' => true],
  21. ],
  22. 'session' => [
  23. // this is the name of the session cookie used for login on the frontend
  24. 'name' => 'advanced-frontend',
  25. ],
  26. 'log' => [
  27. 'traceLevel' => YII_DEBUG ? 3 : 0,
  28. 'targets' => [
  29. [
  30. 'class' => 'yii\log\FileTarget',
  31. 'levels' => ['error', 'warning'],
  32. ],
  33. ],
  34. ],
  35. 'errorHandler' => [
  36. 'errorAction' => 'site/error',
  37. ],
  38. /*
  39. 'urlManager' => [
  40. 'enablePrettyUrl' => true,
  41. 'showScriptName' => false,
  42. 'rules' => [
  43. ],
  44. ],
  45. */
  46. ],
  47. 'params' => $params,
  48. ];