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