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

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

sensorario committed
6
$config = [
7 8
    'id' => 'basic',
    'basePath' => dirname(__DIR__),
9
    'bootstrap' => ['log'],
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
    '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'],
                ],
            ],
        ],
        'db' => $db,
    ],
    'params' => $params,
sensorario committed
38
];
39

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

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

return $config;