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