web.php 1.16 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
    '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'],
                ],
            ],
        ],
33
        'db' => require(__DIR__ . '/db.php'),
34 35
    ],
    'params' => $params,
sensorario committed
36
];
37

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

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

return $config;