web.php 1.35 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
    'components' => [
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        'user' => [
            'identityClass' => 'app\models\User',
            'enableAutoLogin' => true,
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
20
        'mailer' => [
21
            'class' => 'yii\swiftmailer\Mailer',
22 23 24
            // send all mails to a file by default. You have to set
            // 'useFileTransport' to false and configure a transport
            // for the mailer to send real emails.
25 26 27 28 29 30 31 32 33 34 35
            'useFileTransport' => true,
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
36
        'db' => require(__DIR__ . '/db.php'),
37 38
    ],
    'params' => $params,
sensorario committed
39
];
40

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

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

return $config;