web.php 792 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. $params = require(__DIR__ . '/params.php');
  3. $config = array(
  4. 'id' => 'bootstrap',
  5. 'basePath' => dirname(__DIR__),
  6. 'components' => array(
  7. 'request' => array(
  8. 'enableCsrfValidation' => true,
  9. ),
  10. 'cache' => array(
  11. 'class' => 'yii\caching\FileCache',
  12. ),
  13. 'user' => array(
  14. 'identityClass' => 'app\models\User',
  15. ),
  16. 'errorHandler' => array(
  17. 'errorAction' => 'site/error',
  18. ),
  19. 'log' => array(
  20. 'traceLevel' => YII_DEBUG ? 3 : 0,
  21. 'targets' => array(
  22. array(
  23. 'class' => 'yii\log\FileTarget',
  24. 'levels' => array('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;