web.php 811 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. $params = require(__DIR__ . '/params.php');
  3. $config = [
  4. 'id' => 'bootstrap',
  5. 'basePath' => dirname(__DIR__),
  6. 'extensions' => require(__DIR__ . '/../vendor/yii-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. 'log' => [
  21. 'traceLevel' => YII_DEBUG ? 3 : 0,
  22. 'targets' => [
  23. [
  24. 'class' => 'yii\log\FileTarget',
  25. 'levels' => ['error', 'warning'],
  26. ],
  27. ],
  28. ],
  29. ],
  30. 'params' => $params,
  31. ];
  32. if (YII_ENV_DEV) {
  33. $config['preload'][] = 'debug';
  34. $config['modules']['debug'] = 'yii\debug\Module';
  35. $config['modules']['gii'] = 'yii\gii\Module';
  36. }
  37. return $config;