Blame view

frontend/config/main.php 5.16 KB
a0e8d4e0   Alexey Boroda   first commit
1
2
3
  <?php
      use artbox\core\components\LanguageRequest;
      use artbox\core\components\SeoUrlManager;
09140c43   Timur Kastemirov   direct redirects
4
      use frontend\models\DirectRedirects;
a0e8d4e0   Alexey Boroda   first commit
5
6
7
8
9
10
11
12
13
14
      
      $params = array_merge(
          require( __DIR__ . '/../../common/config/params.php' ),
          require( __DIR__ . '/../../common/config/params-local.php' ),
          require( __DIR__ . '/params.php' ),
          require( __DIR__ . '/params-local.php' )
      );
      
      return [
          'id'                  => 'app-frontend',
cd3a2f7d   Timur Kastemirov   главная ru
15
          'homeUrl'             => '/ru',
a0e8d4e0   Alexey Boroda   first commit
16
          'basePath'            => dirname(__DIR__),
b6fe0611   Alexey Boroda   -Compression config
17
18
19
20
          'bootstrap'           => [
              'log',
              'assetsAutoCompress',
          ],
a0e8d4e0   Alexey Boroda   first commit
21
22
          'controllerNamespace' => 'frontend\controllers',
          'components'          => [
b6fe0611   Alexey Boroda   -Compression config
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
              'assetsAutoCompress' => [
                  'class'   => '\skeeks\yii2\assetsAuto\AssetsAutoCompressComponent',
                  'enabled' => true,
                  
                  'readFileTimeout' => 3,
                  //Time in seconds for reading each asset file
                  
                  'jsCompress'                => true,
                  //Enable minification js in html code
                  'jsCompressFlaggedComments' => true,
                  //Cut comments during processing js
                  
                  'cssCompress' => true,
                  //Enable minification css in html code
                  
                  'cssFileCompile'        => true,
                  //Turning association css files
                  'cssFileRemouteCompile' => false,
                  //Trying to get css files to which the specified path as the remote file, skchat him to her.
                  'cssFileCompress'       => true,
                  //Enable compression and processing before being stored in the css file
                  'cssFileBottom'         => false,
                  //Moving down the page css files
                  'cssFileBottomLoadOnJs' => false,
                  //Transfer css file down the page and uploading them using js
                  
                  'jsFileCompile'                 => true,
                  //Turning association js files
                  'jsFileRemouteCompile'          => false,
                  //Trying to get a js files to which the specified path as the remote file, skchat him to her.
                  'jsFileCompress'                => true,
                  //Enable compression and processing js before saving a file
                  'jsFileCompressFlaggedComments' => true,
                  //Cut comments during processing js
                  
                  'htmlCompress'           => true,
                  //Enable compression html
                  'noIncludeJsFilesOnPjax' => true,
                  //Do not connect the js files when all pjax requests
                  'htmlCompressOptions'    =>              //options for compressing output result
                      [
                          'extra'       => false,
                          //use more compact algorithm
                          'no-comments' => true
                          //cut all the html comments
                      ],
              ],
              'request'            => [
a0e8d4e0   Alexey Boroda   first commit
71
72
73
74
                  'class'     => LanguageRequest::className(),
                  'csrfParam' => '_csrf-frontend',
                  'baseUrl'   => '',
              ],
b6fe0611   Alexey Boroda   -Compression config
75
              'user'               => [
a0e8d4e0   Alexey Boroda   first commit
76
77
78
79
80
81
82
                  'identityClass'   => 'common\models\User',
                  'enableAutoLogin' => true,
                  'identityCookie'  => [
                      'name'     => '_identity-frontend',
                      'httpOnly' => true,
                  ],
              ],
b6fe0611   Alexey Boroda   -Compression config
83
              'session'            => [
a0e8d4e0   Alexey Boroda   first commit
84
85
86
                  // this is the name of the session cookie used for login on the frontend
                  'name' => 'advanced-frontend',
              ],
b6fe0611   Alexey Boroda   -Compression config
87
              'log'                => [
a0e8d4e0   Alexey Boroda   first commit
88
89
90
91
92
93
94
95
96
97
98
                  'traceLevel' => YII_DEBUG ? 3 : 0,
                  'targets'    => [
                      [
                          'class'  => 'yii\log\FileTarget',
                          'levels' => [
                              'error',
                              'warning',
                          ],
                      ],
                  ],
              ],
b6fe0611   Alexey Boroda   -Compression config
99
              'errorHandler'       => [
a0e8d4e0   Alexey Boroda   first commit
100
101
                  'errorAction' => 'site/error',
              ],
b6fe0611   Alexey Boroda   -Compression config
102
              'urlManager'         => [
a0e8d4e0   Alexey Boroda   first commit
103
104
                  'class'           => SeoUrlManager::className(),
                  'enablePrettyUrl' => true,
b6fe0611   Alexey Boroda   -Compression config
105
                  'redirects'       => [
09140c43   Timur Kastemirov   direct redirects
106
107
                      DirectRedirects::className(),
                  ],
a0e8d4e0   Alexey Boroda   first commit
108
109
110
                  'showScriptName'  => false,
                  'processRoutes'   => [
                      'page/view',
59700e2c   Alexey Boroda   -Need to add comm...
111
112
113
                      'blog/category',
                      'blog/tag',
                      'blog/article',
e75f2ac9   Alexey Boroda   -Doctor pages fro...
114
                      'persone/view',
5a414589   Alexey Boroda   -Custom rouste added
115
116
117
118
119
120
121
                      'site/about',
                      'site/gallery',
                      'blog/index',
                      'site/price',
                      'site/contact',
                      'persone/index',
                      'site/comments',
a0e8d4e0   Alexey Boroda   first commit
122
123
                  ],
                  'rules'           => [
d7c41411   Alexey Boroda   robots chaged fro...
124
                      '\/robots\.txt' => 'site/robots',
a0e8d4e0   Alexey Boroda   first commit
125
126
127
128
129
                  ],
              ],
          ],
          'params'              => $params,
      ];