|
| 1 | +<?php |
| 2 | + |
| 3 | +$params = require(__DIR__ . '/params.php'); |
| 4 | +$modules = require(__DIR__ . '/modules.php'); |
| 5 | + |
| 6 | +$config = [ |
| 7 | + 'id' => 'app', |
| 8 | + 'name' => 'Application', |
| 9 | + 'basePath' => dirname(__DIR__), |
| 10 | + 'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', |
| 11 | + 'runtimePath' => dirname(dirname(__DIR__)) . '/runtime', |
| 12 | + 'bootstrap' => ['log', 'core'], |
| 13 | + 'components' => [ |
| 14 | + 'formatter' => [ |
| 15 | + 'class' => 'app\components\Formatter', |
| 16 | + ], |
| 17 | + 'request' => [ |
| 18 | + 'cookieValidationKey' => 'RiAveGUdUACvWZppHVevMJRGd5Rij8uh', |
| 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 | + 'useFileTransport' => YII_ENV_DEV, |
| 33 | + ], |
| 34 | + 'i18n' => [ |
| 35 | + 'translations' => [ |
| 36 | + '*' => ['class' => 'yii\i18n\PhpMessageSource'], |
| 37 | + ], |
| 38 | + ], |
| 39 | + 'log' => [ |
| 40 | + 'traceLevel' => YII_DEBUG ? 3 : 0, |
| 41 | + 'targets' => [ |
| 42 | + [ |
| 43 | + 'class' => 'yii\log\FileTarget', |
| 44 | + 'levels' => ['error', 'warning'], |
| 45 | + ], |
| 46 | + ], |
| 47 | + ], |
| 48 | + 'urlManager' => [ |
| 49 | + 'enablePrettyUrl' => true, |
| 50 | + 'showScriptName' => false, |
| 51 | + ], |
| 52 | + 'db' => require(__DIR__ . '/db.php'), |
| 53 | + ], |
| 54 | + 'modules' => $modules, |
| 55 | + 'params' => $params, |
| 56 | +]; |
| 57 | + |
| 58 | +if (YII_ENV_DEV) { |
| 59 | + // configuration adjustments for 'dev' environment |
| 60 | + $config['bootstrap'][] = 'debug'; |
| 61 | + $config['modules']['debug'] = 'yii\debug\Module'; |
| 62 | + |
| 63 | + $config['bootstrap'][] = 'gii'; |
| 64 | + $config['modules']['gii'] = 'yii\gii\Module'; |
| 65 | +} |
| 66 | + |
| 67 | +return $config; |
0 commit comments