-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.php
executable file
·82 lines (81 loc) · 2.91 KB
/
main.php
1
2
3
4
5
6
7
8
9
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
return [
'vendorPath' => dirname(dirname(__DIR__)).'/vendor',
'runtimePath' => '@app/runtime',
'timezone' => 'PRC',
'language' => 'zh-CN',
'bootstrap' => [
'log',
'common\\components\\LoadModule',
'common\\components\\LoadPlugins',
],
'components' => [
'cache' => [
'class' => 'yii\caching\FileCache',
'cachePath' => '@root/cache',
'dirMode' => 0777 // 防止console生成的目录导致web账户没写权限
],
'formatter' => [
'dateFormat' => 'yyyy-MM-dd',
'datetimeFormat' => 'yyyy-MM-dd HH:mm:ss',
'timeFormat' => 'HH:mm:ss',
'decimalSeparator' => '.',
'thousandSeparator' => ' ',
'currencyCode' => 'CNY',
],
'assetManager' => [
'bundles' => [
'yii\web\YiiAsset' => [
'sourcePath' => '@common/static',
'depends' => [
'common\assets\ModalAsset'
]
],
],
],
'i18n' => [
'translations' => [
'*'=> [
'class' => 'yii\i18n\PhpMessageSource',
'basePath'=>'@common/messages',
'fileMap'=>[
'common'=>'common.php',
'backend'=>'backend.php',
'frontend'=>'frontend.php',
],
'on missingTranslation' => ['\backend\modules\i18n\Module', 'missingTranslation']
],
/*'*'=> [
'class' => 'yii\i18n\DbMessageSource',
'sourceMessageTable'=>'{{%i18n_source_message}}',
'messageTable'=>'{{%i18n_message}}',
'enableCaching' => YII_ENV_DEV,
'cachingDuration' => 3600,
'on missingTranslation' => ['\backend\modules\i18n\Module', 'missingTranslation']
],*/
],
],
'log' => [
'targets' => [
'db'=>[
'class' => 'yii\log\DbTarget',
'levels' => ['warning', 'error'],
'except'=>['yii\web\HttpException:*', 'yii\i18n\I18N\*'],
'prefix'=>function () {
$url = !Yii::$app->request->isConsoleRequest ? Yii::$app->request->getUrl() : null;
return sprintf('[%s][%s]', Yii::$app->id, $url);
},
'logVars'=>[],
'logTable'=>'{{%system_log}}'
],
]
],
'notify' => 'common\components\notify\Handler',
'moduleManager' => [
'class' => 'common\\components\\ModuleManager'
],
'pluginManager' => [
'class' => 'common\components\PluginManager',
],
],
];