|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
return [ |
|
4
|
|
|
'id' => 'app-api', |
|
5
|
|
|
'bootstrap' => ['log', 'contentNegotiator'], |
|
6
|
|
|
'controllerNamespace' => 'App\Http\Controller', |
|
7
|
|
|
'viewPath' => '@resources/views', |
|
8
|
|
|
'modules' => [ |
|
9
|
|
|
'api' => [ |
|
10
|
|
|
'class' => \App\Http\Api\Module::class, |
|
11
|
|
|
'modules' => [ |
|
12
|
|
|
'backend' => [ |
|
13
|
|
|
'class' => \App\Http\Api\Backend\Module::class, |
|
14
|
|
|
'modules' => [ |
|
15
|
|
|
'v1' => \App\Http\Api\Backend\Module\V1\Module::class, |
|
16
|
|
|
], |
|
17
|
|
|
], |
|
18
|
|
|
'frontend' => [ |
|
19
|
|
|
'class' => \App\Http\Api\Frontend\Module::class, |
|
20
|
|
|
'modules' => [ |
|
21
|
|
|
'v1' => \App\Http\Api\Frontend\Module\V1\Module::class, |
|
22
|
|
|
], |
|
23
|
|
|
], |
|
24
|
|
|
], |
|
25
|
|
|
], |
|
26
|
|
|
], |
|
27
|
|
|
'components' => [ |
|
28
|
|
|
'request' => [ |
|
29
|
|
|
'csrfParam' => '_csrf-web', |
|
30
|
|
|
'parsers' => [ |
|
31
|
|
|
'application/json' => \yii\web\JsonParser::class, |
|
32
|
|
|
'multipart/form-data' => \yii\web\MultipartFormDataParser::class, |
|
33
|
|
|
], |
|
34
|
|
|
], |
|
35
|
|
|
'response' => [ |
|
36
|
|
|
'format' => \yii\web\Response::FORMAT_HTML, |
|
37
|
|
|
'formatters' => [ |
|
38
|
|
|
\yii\web\Response::FORMAT_JSON => \RazonYang\Yii2\JSend\Formatter::class, |
|
39
|
|
|
], |
|
40
|
|
|
], |
|
41
|
|
|
'contentNegotiator' => [ |
|
42
|
|
|
'class' => \App\Http\Filter\ContentNegotiator::class, |
|
43
|
|
|
'formatParam' => 'format', |
|
44
|
|
|
'formats' => [ |
|
45
|
|
|
'text/html' => 'html', |
|
46
|
|
|
'application/json' => 'json', |
|
47
|
|
|
], |
|
48
|
|
|
'languages' => ['zh-CN', 'zh-TW', 'en'], |
|
49
|
|
|
'languageParam' => 'lang', |
|
50
|
|
|
], |
|
51
|
|
|
'user' => [ |
|
52
|
|
|
'identityClass' => \App\Model\User::class, |
|
53
|
|
|
'enableAutoLogin' => false, |
|
54
|
|
|
'enableSession' => true, |
|
55
|
|
|
'identityCookie' => ['name' => '_identity-web', 'httpOnly' => true], |
|
56
|
|
|
], |
|
57
|
|
|
'log' => [ |
|
58
|
|
|
'traceLevel' => YII_DEBUG ? 3 : 0, |
|
59
|
|
|
'targets' => [ |
|
60
|
|
|
'file' => [ |
|
61
|
|
|
'class' => 'yii\log\FileTarget', |
|
62
|
|
|
'logFile' => '@runtime/logs/web.log', |
|
63
|
|
|
'levels' => ['error', 'warning'], |
|
64
|
|
|
], |
|
65
|
|
|
], |
|
66
|
|
|
], |
|
67
|
|
|
'errorHandler' => [ |
|
68
|
|
|
'class' => \RazonYang\Yii2\JSend\ErrorHandler::class, |
|
69
|
|
|
'errorAction' => 'site/error', |
|
70
|
|
|
], |
|
71
|
|
|
'i18n' => [ |
|
72
|
|
|
'translations' => [ |
|
73
|
|
|
'api' => [ |
|
74
|
|
|
'class' => \yii\i18n\PhpMessageSource::class, |
|
75
|
|
|
'basePath' => '@resources/messages', |
|
76
|
|
|
'sourceLanguage' => 'en-US', |
|
77
|
|
|
'fileMap' => [ |
|
78
|
|
|
'api' => 'api.php', |
|
79
|
|
|
], |
|
80
|
|
|
], |
|
81
|
|
|
], |
|
82
|
|
|
], |
|
83
|
|
|
'urlManager' => [ |
|
84
|
|
|
'class' => \yii\web\UrlManager::class, |
|
85
|
|
|
'cache' => false, |
|
86
|
|
|
'enablePrettyUrl' => true, |
|
87
|
|
|
'showScriptName' => false, |
|
88
|
|
|
'enableStrictParsing' => true, |
|
89
|
|
|
'rules' => require __DIR__ . '/routes.php', |
|
90
|
|
|
], |
|
91
|
|
|
'jsend' => function () { |
|
92
|
|
|
return new \RazonYang\Jsend\Jsend(); |
|
|
|
|
|
|
93
|
|
|
}, |
|
94
|
|
|
], |
|
95
|
|
|
]; |
|
96
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths