web.php 874 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. $params = require(__DIR__ . '/params.php');
  3. $config = [
  4. 'id' => 'bootstrap',
  5. 'basePath' => dirname(__DIR__),
  6. 'extensions' => require(__DIR__ . '/../vendor/yiisoft/extensions.php'),
  7. 'components' => [
  8. 'request' => [
  9. 'enableCsrfValidation' => true,
  10. ],
  11. 'cache' => [
  12. 'class' => 'yii\caching\FileCache',
  13. ],
  14. 'user' => [
  15. 'identityClass' => 'app\models\User',
  16. ],
  17. 'errorHandler' => [
  18. 'errorAction' => 'site/error',
  19. ],
  20. 'mail' => [
  21. 'class' => 'yii\swiftmailer\Mailer',
  22. ],
  23. 'log' => [
  24. 'traceLevel' => YII_DEBUG ? 3 : 0,
  25. 'targets' => [
  26. [
  27. 'class' => 'yii\log\FileTarget',
  28. 'levels' => ['error', 'warning'],
  29. ],
  30. ],
  31. ],
  32. ],
  33. 'params' => $params,
  34. ];
  35. if (YII_ENV_DEV) {
  36. $config['preload'][] = 'debug';
  37. $config['modules']['debug'] = 'yii\debug\Module';
  38. $config['modules']['gii'] = 'yii\gii\Module';
  39. }
  40. return $config;