You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.1 KiB

8 months ago
  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. // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
  15. 'cookieValidationKey' => 'hovIi5cjCDE92evC_zPUv3332pNJ7sIC',
  16. ],
  17. 'cache' => [
  18. 'class' => 'yii\caching\FileCache',
  19. ],
  20. 'user' => [
  21. 'identityClass' => 'app\models\User',
  22. 'enableAutoLogin' => true,
  23. ],
  24. 'errorHandler' => [
  25. 'errorAction' => 'site/error',
  26. ],
  27. 'mailer' => [
  28. 'class' => \yii\symfonymailer\Mailer::class,
  29. 'viewPath' => '@app/mail',
  30. // send all mails to a file by default.
  31. 'useFileTransport' => true,
  32. ],
  33. 'log' => [
  34. 'traceLevel' => YII_DEBUG ? 3 : 0,
  35. 'targets' => [
  36. [
  37. 'class' => 'yii\log\FileTarget',
  38. 'levels' => ['error', 'warning'],
  39. ],
  40. ],
  41. ],
  42. 'db' => $db,
  43. /*
  44. 'urlManager' => [
  45. 'enablePrettyUrl' => true,
  46. 'showScriptName' => false,
  47. 'rules' => [
  48. ],
  49. ],
  50. */
  51. ],
  52. 'params' => $params,
  53. ];
  54. if (YII_ENV_DEV) {
  55. // configuration adjustments for 'dev' environment
  56. $config['bootstrap'][] = 'debug';
  57. $config['modules']['debug'] = [
  58. 'class' => 'yii\debug\Module',
  59. // uncomment the following to add your IP if you are not connecting from localhost.
  60. //'allowedIPs' => ['127.0.0.1', '::1'],
  61. ];
  62. $config['bootstrap'][] = 'gii';
  63. $config['modules']['gii'] = [
  64. 'class' => 'yii\gii\Module',
  65. // uncomment the following to add your IP if you are not connecting from localhost.
  66. //'allowedIPs' => ['127.0.0.1', '::1'],
  67. ];
  68. }
  69. return $config;