web.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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' => 'app\modules\pdf\Module'],
  67. 'excel' => ['class' => 'app\modules\excel\Module'],
  68. ]
  69. ];
  70. if (YII_ENV_DEV) {
  71. // configuration adjustments for 'dev' environment
  72. $config['bootstrap'][] = 'debug';
  73. $config['modules']['debug'] = [
  74. 'class' => 'yii\debug\Module',
  75. // uncomment the following to add your IP if you are not connecting from localhost.
  76. //'allowedIPs' => ['127.0.0.1', '::1'],
  77. ];
  78. $config['bootstrap'][] = 'gii';
  79. $config['modules']['gii'] = [
  80. 'class' => 'yii\gii\Module',
  81. // uncomment the following to add your IP if you are not connecting from localhost.
  82. //'allowedIPs' => ['127.0.0.1', '::1'],
  83. ];
  84. }
  85. return $config;