web.php 742 B

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