web.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. $params = require __DIR__ . '/params.php';
  3. $db = require __DIR__ . '/db.php';
  4. $config = [
  5. 'id' => 'basic',
  6. 'basePath' => dirname(__DIR__),
  7. 'bootstrap' => ['log'],
  8. 'aliases' => [
  9. '@bower' => '@vendor/bower-asset',
  10. '@npm' => '@vendor/npm-asset',
  11. ],
  12. 'components' => [
  13. 'request' => [
  14. 'cookieValidationKey' => 'MwDzyBzzBQMMA8d_tiCkX-h5oMhAg8jK',
  15. 'parsers' => [
  16. 'application/json' => 'yii\web\JsonParser',
  17. ],
  18. ],
  19. 'cache' => [
  20. 'class' => 'yii\caching\FileCache',
  21. ],
  22. 'user' => [
  23. 'identityClass' => 'app\models\User',
  24. 'enableAutoLogin' => true,
  25. ],
  26. 'errorHandler' => [
  27. 'errorAction' => 'site/error',
  28. ],
  29. 'mailer' => [
  30. 'class' => 'yii\swiftmailer\Mailer',
  31. // send all mails to a file by default. You have to set
  32. // 'useFileTransport' to false and configure transport
  33. // for the mailer to send real emails.
  34. 'useFileTransport' => true,
  35. ],
  36. 'log' => [
  37. 'traceLevel' => YII_DEBUG ? 3 : 0,
  38. 'targets' => [
  39. [
  40. 'class' => 'yii\log\FileTarget',
  41. 'levels' => ['error', 'warning'],
  42. ],
  43. ],
  44. ],
  45. 'db' => $db,
  46. 'urlManager' => [
  47. 'enablePrettyUrl' => true,
  48. 'showScriptName' => false,
  49. 'rules' => [
  50. [
  51. 'class' => 'common\rest\UrlRule',
  52. 'controller' => [
  53. 'v1/default',
  54. 'v1/dependencia',
  55. 'v1/evento',
  56. 'v1/grupo',
  57. 'v1/resultado',
  58. 'v1/usuario'
  59. ],
  60. ]
  61. ],
  62. ],
  63. ],
  64. 'params' => $params,
  65. 'modules' => [
  66. 'v1' => ['class' => 'v1\Module'],
  67. ]
  68. ];
  69. if (YII_ENV_DEV) {
  70. // configuration adjustments for 'dev' environment
  71. $config['bootstrap'][] = 'debug';
  72. $config['modules']['debug'] = [
  73. 'class' => 'yii\debug\Module',
  74. // uncomment the following to add your IP if you are not connecting from localhost.
  75. //'allowedIPs' => ['127.0.0.1', '::1'],
  76. ];
  77. $config['bootstrap'][] = 'gii';
  78. $config['modules']['gii'] = [
  79. 'class' => 'yii\gii\Module',
  80. // uncomment the following to add your IP if you are not connecting from localhost.
  81. //'allowedIPs' => ['127.0.0.1', '::1'],
  82. ];
  83. }
  84. return $config;