web.php 1.24 KB
Newer Older
Qiang Xue committed
1
<?php
2

3
$params = require(__DIR__ . '/params.php');
4

sensorario committed
5
$config = [
6 7
    'id' => 'basic',
    'basePath' => dirname(__DIR__),
8
    'bootstrap' => ['log'],
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
    'extensions' => require(__DIR__ . '/../vendor/yiisoft/extensions.php'),
    'components' => [
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        'user' => [
            'identityClass' => 'app\models\User',
            'enableAutoLogin' => true,
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
        'mail' => [
            'class' => 'yii\swiftmailer\Mailer',
            'useFileTransport' => true,
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
34
        'db' => require(__DIR__ . '/db.php'),
35 36
    ],
    'params' => $params,
sensorario committed
37
];
38

Qiang Xue committed
39
if (YII_ENV_DEV) {
40
    // configuration adjustments for 'dev' environment
41
    $config['bootstrap'][] = 'debug';
42
    $config['modules']['debug'] = 'yii\debug\Module';
43 44

    $config['bootstrap'][] = 'gii';
45
    $config['modules']['gii'] = 'yii\gii\Module';
46 47 48
}

return $config;