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

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

return $config;