OSDN Git Service

Добавление Мест размещения и регионов (подразделений)
[invent/invent.git] / config / web.php
1 <?php
2
3 $params = require __DIR__ . '/params.php';
4 $db = require __DIR__ . '/db.php';
5
6 $config = [
7     'name' => "Inventory",
8     'id' => 'basic',
9     'basePath' => dirname(__DIR__),
10     'language' => 'ru-RU',
11     'bootstrap' => ['log'],
12     'aliases' => [
13         '@bower' => '@vendor/bower-asset',
14         '@npm'   => '@vendor/npm-asset',
15     ],
16     'components' => [
17         'request' => [
18             // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
19             'cookieValidationKey' => '4u6WczdipA-FIzbuf8PYgjoiid_6zdNy',
20         ],
21         'cache' => [
22             'class' => 'yii\caching\FileCache',
23         ],
24         'user' => [
25             'identityClass' => 'app\models\User',
26             'enableAutoLogin' => true,
27         ],
28         'errorHandler' => [
29             'errorAction' => 'site/error',
30         ],
31         'mailer' => [
32             'class' => 'yii\swiftmailer\Mailer',
33             // send all mails to a file by default. You have to set
34             // 'useFileTransport' to false and configure a transport
35             // for the mailer to send real emails.
36             'useFileTransport' => false,
37         ],
38         'log' => [
39             'traceLevel' => YII_DEBUG ? 3 : 0,
40             'targets' => [
41                 [
42                     'class' => 'yii\log\FileTarget',
43                     'levels' => ['error', 'warning'],
44                 ],
45             ],
46         ],
47         'i18n' => [
48             'translations' => [
49                 'app*' => [
50                     'class' => 'yii\i18n\PhpMessageSource',
51                     'sourceLanguage' => 'en-US',
52                     'basePath' => '@app/messages',
53                     'fileMap' => [
54                         'app'       => 'app.php',
55                         'app/error' => 'error.php',
56                     ],
57                 ],
58                 'items*' => [
59                     'class' => 'yii\i18n\PhpMessageSource',
60                     'sourceLanguage' => 'en-US',
61                     'basePath' => '@app/messages',
62                     'fileMap' => [
63                         'app' => 'items.app',
64                     ],
65                 ],
66                 'types*' => [
67                     'class' => 'yii\i18n\PhpMessageSource',
68                     'sourceLanguage' => 'en-US',
69                     'basePath' => '@app/messages',
70                     'fileMap' => [
71                         'app' => 'types.app',
72                     ],
73                 ],
74                 'status*' => [
75                     'class' => 'yii\i18n\PhpMessageSource',
76                     'sourceLanguage' => 'en-US',
77                     'basePath' => '@app/messages',
78                     'fileMap' => [
79                         'app' => 'status.app',
80                     ],
81                 ],
82                 'locations*' => [
83                     'class' => 'yii\i18n\PhpMessageSource',
84                     'sourceLanguage' => 'en-US',
85                     'basePath' => '@app/messages',
86                     'fileMap' => [
87                         'app' => 'locations.app',
88                     ],
89                 ],
90                 'regions*' => [
91                     'class' => 'yii\i18n\PhpMessageSource',
92                     'sourceLanguage' => 'en-US',
93                     'basePath' => '@app/messages',
94                     'fileMap' => [
95                         'app' => 'regions.app',
96                     ],
97                 ],
98                 'contact*' => [
99                     'class' => 'yii\i18n\PhpMessageSource',
100                     'sourceLanguage' => 'en-US',
101                     'basePath' => '@app/messages',
102                     'fileMap' => [
103                         'app'   => 'contact.app',
104                     ],
105                 ],
106             ],
107         ],
108         'db' => $db,
109         /*
110         'urlManager' => [
111             'enablePrettyUrl' => true,
112             'showScriptName' => false,
113             'rules' => [
114             ],
115         ],
116         */
117     ],
118     'params' => $params,
119 ];
120
121 if (YII_ENV_DEV) {
122     // configuration adjustments for 'dev' environment
123     $config['bootstrap'][] = 'debug';
124     $config['modules']['debug'] = [
125         'class' => 'yii\debug\Module',
126         // uncomment the following to add your IP if you are not connecting from localhost.
127         'allowedIPs' => ['127.0.0.1', '::1', '192.168.0.68'],
128     ];
129
130     $config['bootstrap'][] = 'gii';
131     $config['modules']['gii'] = [
132         'class' => 'yii\gii\Module',
133         // uncomment the following to add your IP if you are not connecting from localhost.
134         'allowedIPs' => ['127.0.0.1', '::1', '192.168.0.68'],
135     ];
136 }
137
138 return $config;