web.php 979 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
		'mail' => [
			'class' => 'yii\swiftmailer\Mailer',
Mark committed
23
			'useFileTransport' => true,
24
		],
sensorario committed
25
		'log' => [
26
			'traceLevel' => YII_DEBUG ? 3 : 0,
sensorario committed
27 28
			'targets' => [
				[
Qiang Xue committed
29
					'class' => 'yii\log\FileTarget',
sensorario committed
30 31 32 33
					'levels' => ['error', 'warning'],
				],
			],
		],
34
		'db' => $db,
sensorario committed
35
	],
36
	'params' => $params,
sensorario committed
37
];
38

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

return $config;