Blame view

frontend/config/main.php 7.36 KB
4253cbec   root   first commit
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
  <?php

  $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',

      'basePath' => dirname(__DIR__),

      'bootstrap' => [

  

          'frontend\components\SeoComponent',

      ],

      'controllerNamespace' => 'frontend\controllers',

      'modules' => [

  //        'comment' => [

  //            'class' => 'common\modules\comment\Module',

  //            'useRbac' => false,

  //            'rbac' => [

  //                'rules' => [

  //                    \common\modules\comment\rbac\ArtboxCommentCreateRule::className(),

  //                    \common\modules\comment\rbac\ArtboxCommentDeleteRule::className(),

  //                    \common\modules\comment\rbac\ArtboxCommentUpdateRule::className(),

  //                    \common\modules\comment\rbac\ArtboxCommentUpdateOwnRule::className(),

  //                    \common\modules\comment\rbac\ArtboxCommentDeleteOwnRule::className(),

  //                ],

  //                'permissions' => [

  //                    [

  //                        'name' => common\modules\comment\Permissions::CREATE,

  //                        'description' => 'Can create comments',

  //                        'ruleName' =>(new \common\modules\comment\rbac\ArtboxCommentCreateRule())->name,

  //                    ],

  //                    [

  //                        'name' => common\modules\comment\Permissions::UPDATE,

  //                        'description' => 'Can update comments',

  //                        'ruleName' =>(new \common\modules\comment\rbac\ArtboxCommentUpdateRule())->name,

  //                    ],

  //                    [

  //                        'name' => common\modules\comment\Permissions::DELETE,

  //                        'description' => 'Can delete comments',

  //                        'ruleName' =>(new \common\modules\comment\rbac\ArtboxCommentDeleteRule())->name,

  //                    ],

  //                    [

  //                        'name' => common\modules\comment\Permissions::UPDATE_OWN,

  //                        'description' => 'Can update own comments',

  //                        'ruleName' =>(new \common\modules\comment\rbac\ArtboxCommentUpdateOwnRule())->name,

  //                    ],

  //                    [

  //                        'name' => common\modules\comment\Permissions::DELETE_OWN,

  //                        'description' => 'Can delete own comments',

  //                        'ruleName' =>(new \common\modules\comment\rbac\ArtboxCommentDeleteOwnRule())->name,

  //                    ],

  //                ],

  //            ],

  //

  //        ],

      ],

      'components' => [

  

          'authManager' => [

              'class' => 'yii\rbac\DbManager',

          ],

          'user' => [

              'identityClass'   => 'common\models\Customer',

              'enableAutoLogin' => true,

              'loginUrl'        => ['login'],

          ],

          'request'=>[

              'cookieValidationKey' => 'ndahjhjjidasuidrqeswuiuirqw89',

              'csrfParam' => '_frontendCSRF',

              'class' => 'common\components\Request',

  

              'web'=> '/frontend/web'

  

          ],

  

          'log' => [

              'traceLevel' => YII_DEBUG ? 3 : 0,

              'targets' => [

                  [

                      'class' => 'yii\log\FileTarget',

                      'levels' => ['error', 'warning'],

                  ],

              ],

          ],

          'errorHandler' => [

              'errorAction' => 'site/error',

          ],

          /*'imageCache' => [

              'class' => 'iutbay\yii2imagecache\ImageCache',

              'sourcePath' => '@app/web/images',

              'sourceUrl' => '@web/images',

              'thumbsPath' => '@app/web/thumbs',

              'thumbsUrl' => '@web/thumbs',

              'resizeMode' => 'inset',

              'sizes' => [

                  'brandlist' => [128, 128],

                  'product' => [300, 300],

                  'product_trumb' => [80, 80],

                  'product_trumb2' => [100, 100],

                  'list' => [134, 200],

                  'product_list2' => [130, 70],

                  'product_variant' => [42, 42],

                  'mainmenu' => [160, 170],

                  'large' => [600, 600],

              ],

          ],*/

          'urlManager'   => [

              'enablePrettyUrl' => true,

              'showScriptName'  => false,

              'rules'           => [

                  ''                                                                 => 'site/index',

                  'login'                                                            => 'login/index',

                  'iam'                                                              => 'iam/index',

                  'text/<translit:[\w\_\-]+>'                                              => 'text/index',

                  '<language:(ru|ua|en)>/text/<translit:\w+>'                        => 'text/index',

                  [

                      'class' => '\common\modules\product\CatalogUrlManager',

                      'route_map' => [

                          'catalog' => 'catalog/category',

                          'product' => 'catalog/product',

  

                      ]

                  ],

                  'priceparam.xml'    => 'site/priceparam',

                  'price.xml'         => 'site/price',

                  'smstest'           => 'site/sms',

                  'search' => 'search/index',

  //                'catalog'                                                          => 'catalog/all',

  //                'catalog/<translit:\w+>'                                           => 'catalog/index',

  //                'products/search'                                                  => 'products/search',

  //                'products/compare'                                                 => 'products/compare',

  //                'products/<translit:\w+>'                                          => 'products/index',

  //                'products/<translit_rubric:\w+>/<translit:[\w\-]+>-<id:\d+>'       => 'products/show',

                  'news/<translit:\w+>-<id:\d+>'                                     => 'news/show',

                  'brands'                                                           => 'catalog/brands',

                  'brands/<brand:[\w\-]+>'                                           => 'catalog/brand',

                  'blog'                                                             => 'articles/index',

                  'blog/<translit:[\w\-]+>-<id:\d+>'                                 => 'articles/show',

                  'event'                                                             => 'event/index',

                  'event/<alias:[\w\-]+>-<id:\d+>'                                   => 'event/show',

                  '<language:(ru|ua|en)>/<module:\w+>/<controller:\w+>/<action:\w+>' => '<module>/<controller>/<action>',

                  '<language:(ru|ua|en)>/<controller:\w+>/<action:\w+>'              => '<controller>/<action>',

                  '<language:(ru|ua|en)>/admin'                                      => 'admin/default/index',

                  '<language:(ru|ua|en)>/admin/users'                                => 'admin/users/index',

                  'thumbs/<path:.*>' => 'site/thumb',

              ],

  

          ],

  

      ],

      'params' => $params,

  ];