1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Configuration file for the "yii asset" console command. |
4
|
|
|
* Note that in the console environment, some path aliases like '@webroot' and '@web' may not exist. |
5
|
|
|
* Please define these missing path aliases. |
6
|
|
|
*/ |
7
|
|
|
return [ |
8
|
|
|
// Adjust command/callback for JavaScript files compressing: |
9
|
|
|
'jsCompressor' => 'java -jar /root/compiler.jar --js {from} --js_output_file {to}', |
10
|
|
|
// Adjust command/callback for CSS files compressing: |
11
|
|
|
'cssCompressor' => 'yui-compressor --type css {from} -o {to}', |
12
|
|
|
// The list of asset bundles to compress: |
13
|
|
|
'bundles' => [ |
14
|
|
|
'app\assets\AppAsset', |
15
|
|
|
'app\modules\backend\assets\AdminAsset', |
16
|
|
|
\dmstr\web\AdminLteAsset::className(), |
17
|
|
|
], |
18
|
|
|
// Asset bundle for compression output: |
19
|
|
|
'targets' => [ |
20
|
|
|
'frontend' => [ |
21
|
|
|
'class' => 'yii\web\AssetBundle', |
22
|
|
|
'basePath' => '@app/../web/assets-prod', |
23
|
|
|
'baseUrl' => '@web/assets-prod', |
24
|
|
|
'js' => 'js/frontend-{hash}.js', |
25
|
|
|
'css' => 'css/frontend-{hash}.css', |
26
|
|
|
'depends' => [ |
27
|
|
|
// Include only 'frontend' assets: |
|
|
|
|
28
|
|
|
'app\assets\AppAsset', |
29
|
|
|
], |
30
|
|
|
], |
31
|
|
|
'backend' => [ |
32
|
|
|
'class' => 'yii\web\AssetBundle', |
33
|
|
|
'basePath' => '@app/../web/assets-prod', |
34
|
|
|
'baseUrl' => '@web/assets-prod', |
35
|
|
|
'js' => 'js/backend-{hash}.js', |
36
|
|
|
'css' => 'css/backend-{hash}.css', |
37
|
|
|
'depends' => [ |
38
|
|
|
// Include only 'backend' assets: |
|
|
|
|
39
|
|
|
'app\modules\backend\assets\AdminAsset', |
40
|
|
|
\dmstr\web\AdminLteAsset::className(), |
41
|
|
|
], |
42
|
|
|
], |
43
|
|
|
'all' => [ |
44
|
|
|
'class' => 'yii\web\AssetBundle', |
45
|
|
|
'basePath' => '@app/../web/assets-prod', |
46
|
|
|
'baseUrl' => '@web/assets-prod', |
47
|
|
|
'js' => 'js/all-{hash}.js', |
48
|
|
|
'css' => 'css/all-{hash}.css', |
49
|
|
|
], |
50
|
|
|
], |
51
|
|
|
// Asset manager configuration: |
52
|
|
|
'assetManager' => [ |
53
|
|
|
'basePath' => '/app/web/assets-prod', |
54
|
|
|
'baseUrl' => '/assets-prod', |
55
|
|
|
], |
56
|
|
|
]; |
57
|
|
|
|
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.