Blame view

common/config/main.php 7.33 KB
3a00e6d1   Yarik   Files added
1
  <?php
ee968c15   Yarik   Filters
2
      use artbox\catalog\helpers\FilterHelper;
a509da1c   Yarik   Artbox epic perfo...
3
      use artbox\core\components\AliasCache;
3a00e6d1   Yarik   Files added
4
      use artbox\core\components\SeoComponent;
c6b72911   Yarik   Odoo completed
5
      use artbox\odoo\components\OdooMapper;
3a00e6d1   Yarik   Files added
6
7
8
9
      
      return [
          'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
          'modules'    => [
222b0897   Yarik   Artbox comment cr...
10
              'imagemanager'   => [
8e418b22   Alexey Boroda   -Image manager st...
11
                  'class'                => 'artbox\core\components\imagemanager\Module',
3a00e6d1   Yarik   Files added
12
13
14
15
16
17
18
19
20
                  'canUploadImage'       => true,
                  'canRemoveImage'       => function () {
                      return true;
                  },
                  'setBlameableBehavior' => false,
                  'cssFiles'             => [
                      'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css',
                  ],
              ],
222b0897   Yarik   Artbox comment cr...
21
              'artbox-comment' => [
e950ba39   Yarik   Artbox comment pr...
22
23
                  'class'             => 'artbox\webcomment\Module',
                  'enablePremoderate' => false,
222b0897   Yarik   Artbox comment cr...
24
              ],
3a00e6d1   Yarik   Files added
25
26
27
28
29
30
31
          ],
          'components' => [
              'cache'        => [
                  'class' => 'yii\caching\FileCache',
              ],
              'i18n'         => [
                  'translations' => [
222b0897   Yarik   Artbox comment cr...
32
                      'core'           => [
3a00e6d1   Yarik   Files added
33
                          'class'    => 'yii\i18n\PhpMessageSource',
ee968c15   Yarik   Filters
34
                          'basePath' => '@artbox/core/messages',
3a00e6d1   Yarik   Files added
35
                      ],
222b0897   Yarik   Artbox comment cr...
36
                      'catalog'        => [
421ec2e8   Yarik   Langs
37
38
39
                          'class'    => 'yii\i18n\PhpMessageSource',
                          'basePath' => '@artbox/catalog/messages',
                      ],
222b0897   Yarik   Artbox comment cr...
40
                      'app'            => [
3a00e6d1   Yarik   Files added
41
42
43
                          'class'    => 'yii\i18n\PhpMessageSource',
                          'basePath' => '@common/messages',
                      ],
222b0897   Yarik   Artbox comment cr...
44
                      'blog'           => [
6b833fda   Alexey Boroda   -Bug with fill re...
45
46
47
                          'class'    => 'yii\i18n\PhpMessageSource',
                          'basePath' => '@artbox/weblog/messages',
                      ],
222b0897   Yarik   Artbox comment cr...
48
                      'order'          => [
4bf9edb7   Yarik   Order
49
50
51
                          'class'    => 'yii\i18n\PhpMessageSource',
                          'basePath' => '@artbox/order/messages',
                      ],
222b0897   Yarik   Artbox comment cr...
52
53
54
55
                      'artbox-comment' => [
                          'class'    => 'yii\i18n\PhpMessageSource',
                          'basePath' => '@artbox/webcomment/messages',
                      ],
a00f1f42   Yarik   Social auth + vie...
56
57
58
59
                      'eauth'          => [
                          'class'    => 'yii\i18n\PhpMessageSource',
                          'basePath' => '@eauth/messages',
                      ],
c6b72911   Yarik   Odoo completed
60
61
62
63
                      'odoo'           => [
                          'class'    => 'yii\i18n\PhpMessageSource',
                          'basePath' => '@artbox/odoo/messages',
                      ],
3a00e6d1   Yarik   Files added
64
65
66
67
68
69
70
71
72
73
74
75
76
77
                  ],
              ],
              'filedb'       => [
                  'class' => 'yii2tech\filedb\Connection',
                  'path'  => '@common/config',
              ],
              'sitemapdb'    => [
                  'class'          => 'yii2tech\filedb\Connection',
                  'path'           => '@common/config',
                  'primaryKeyName' => 'id',
              ],
              'seo'          => [
                  'class' => SeoComponent::className(),
              ],
ee968c15   Yarik   Filters
78
79
80
              'filter'       => [
                  'class' => FilterHelper::className(),
              ],
3a00e6d1   Yarik   Files added
81
              'imagemanager' => [
8e418b22   Alexey Boroda   -Image manager st...
82
                  'class'       => 'artbox\core\components\imagemanager\components\ImageManagerGetPath',
bf6f4dcb   Alexey Boroda   -Image model
83
                  'mediaPath'   => dirname(dirname(__DIR__)) . '/storage',
98b5afb8   Alexey Boroda   -Menu and bug fix
84
                  'cachePath'   => '../../storage/cache',
3a00e6d1   Yarik   Files added
85
86
87
                  'useFilename' => true,
                  'absoluteUrl' => false,
              ],
a509da1c   Yarik   Artbox epic perfo...
88
89
90
              'aliasCache'   => [
                  'class' => AliasCache::className(),
              ],
c6b72911   Yarik   Odoo completed
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
              'odooMapper'   => [
                  'class' => OdooMapper::className(),
                  'map'   => [
                      'id'              => 'remote_id',
                      'active'          => 'status',
                      'create_date'     => [
                          'attribute' => 'created_at',
                          'artbox'    => function ($field) {
                              return strtotime($field);
                          },
                          'odoo'      => function ($field) {
                              return date('Y-m-d H:i:s', $field);
                          },
                      ],
                      '__last_update'   => [
                          'attribute' => 'updated_at',
                          'artbox'    => function ($field) {
                              return strtotime($field);
                          },
                          'odoo'      => function ($field) {
                              return date('Y-m-d H:i:s', $field);
                          },
                      ],
                      'name'            => 'title',
                      'default_code'    => 'sku',
                      'list_price'      => 'price',
                      'product_id'      => [
                          'attribute' => 'variant_id',
                          'artbox'    => function ($field) {
                              return $field[ 0 ];
                          },
                          'odoo'      => function ($field) {
                              return [ $field ];
                          },
                      ],
                      'price_unit'      => 'price',
                      'product_uom_qty' => 'count',
                      'categ_id'        => 'category',
                      'contact_address' => [
                          'attribute' => 'address',
                          'artbox'    => function ($field) {
                              return strval($field);
                          },
                          'odoo'      => function ($field) {
                              return boolval($field);
                          },
                      ],
                      'phone'           => [
                          'attribute' => 'phone',
                          'artbox'    => function ($field) {
                              return strval($field);
                          },
                          'odoo'      => function ($field) {
                              return boolval($field);
                          },
                      ],
                      'email'           => [
                          'attribute' => 'email',
                          'artbox'    => function ($field) {
                              return strval($field);
                          },
                          'odoo'      => function ($field) {
                              return boolval($field);
                          },
                      ],
                      'city'            => [
                          'attribute' => 'city',
                          'artbox'    => function ($field) {
                              return strval($field);
                          },
                          'odoo'      => function ($field) {
                              return boolval($field);
                          },
                      ],
                      'comment'         => [
                          'attribute' => 'comment',
                          'artbox'    => function ($field) {
                              return strval($field);
                          },
                          'odoo'      => function ($field) {
                              return boolval($field);
                          },
                      ],
                  ],
              ],
3a00e6d1   Yarik   Files added
176
177
          ],
      ];