web.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. 'v1/taller'
  58. ],
  59. ]
  60. ],
  61. ],
  62. ],
  63. 'params' => $params,
  64. 'modules' => [
  65. 'v1' => ['class' => 'v1\Module'],
  66. 'pdf' => ['class' => 'pdf\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;