web.php 2.0 KB

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