main.php 1009 Bytes
Newer Older
1
<?php
Veaceslav Medvedev committed
2
$rootDir = dirname(dirname(__DIR__));
3 4 5 6 7 8 9 10

$params = array_merge(
	require($rootDir . '/common/config/params.php'),
	require($rootDir . '/common/config/params-local.php'),
	require(__DIR__ . '/params.php'),
	require(__DIR__ . '/params-local.php')
);

Alexander Makarov committed
11
return [
Qiang Xue committed
12
	'id' => 'app-backend',
13
	'basePath' => dirname(__DIR__),
Veaceslav Medvedev committed
14
	'vendorPath' => $rootDir . '/vendor',
Alexander Makarov committed
15
	'preload' => ['log'],
16
	'controllerNamespace' => 'backend\controllers',
Alexander Makarov committed
17
	'modules' => [],
Veaceslav Medvedev committed
18
	'extensions' => require($rootDir . '/vendor/yiisoft/extensions.php'),
Alexander Makarov committed
19
	'components' => [
20
		'db' => $params['components.db'],
21
		'cache' => $params['components.cache'],
22
		'mail' => $params['components.mail'],
Alexander Makarov committed
23
		'user' => [
24
			'identityClass' => 'common\models\User',
25
			'enableAutoLogin' => true,
Alexander Makarov committed
26 27
		],
		'log' => [
28
			'traceLevel' => YII_DEBUG ? 3 : 0,
Alexander Makarov committed
29 30
			'targets' => [
				[
Qiang Xue committed
31
					'class' => 'yii\log\FileTarget',
Alexander Makarov committed
32 33 34 35 36
					'levels' => ['error', 'warning'],
				],
			],
		],
		'errorHandler' => [
37
			'errorAction' => 'site/error',
Alexander Makarov committed
38 39
		],
	],
40
	'params' => $params,
Alexander Makarov committed
41
];