6 $params = require __DIR__ . '/params.php';
7 $db = require __DIR__ . '/db.php';
9 function showUrlUpdate($name, $data)
11 return Html::a(Html::encode($name),
17 function writeLog($logline)
19 $fp = fopen('data.log', 'a');
20 fwrite($fp, $logline . "\n");
26 'name' => 'Inventory',
28 'basePath' => dirname(__DIR__),
29 'language' => 'ru-RU',
30 'bootstrap' => ['log'],
32 '@bower' => '@vendor/bower-asset',
33 '@npm' => '@vendor/npm-asset',
37 // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
38 'cookieValidationKey' => '4u6WczdipA-FIzbuf8PYgjoiid_6zdNy',
40 'pdf' => [ // Формирование PDF по умолчанию
41 'mode' => Pdf::MODE_UTF8, // Кодировка
42 'class' => Pdf::className(),
43 'format' => Pdf::FORMAT_A4, // Лист А4
44 'orientation' => Pdf::ORIENT_PORTRAIT, // Напраление - по вертикали большая сторона
45 'destination' => Pdf::DEST_BROWSER, // Результат показать в браузере
46 'cssFile' => '@vendor/kartik-v/yii2-mpdf/src/assets/kv-mpdf-bootstrap.min.css',
47 'cssInline' => '.kv-heading-1{font-size:18px}',
49 'SetHeader' => [Yii::t('app', Yii::$app->name)], // Верхний колонтитул
50 'SetFooter' => ['{PAGENO}'], // Нижний колонтитул
52 // refer settings section for all configuration options
56 'class' => 'yii\caching\FileCache',
60 'identityClass' => 'app\models\User',
61 'enableAutoLogin' => true,
65 'errorAction' => 'site/error',
69 'class' => 'yii\swiftmailer\Mailer',
70 // send all mails to a file by default. You have to set
71 // 'useFileTransport' to false and configure a transport
72 // for the mailer to send real emails.
73 'useFileTransport' => false,
77 'traceLevel' => YII_DEBUG ? 3 : 0,
80 'class' => 'yii\log\FileTarget',
81 'levels' => ['error', 'warning'],
86 'i18n' => [ // Переводы сообщений
88 'app*' => [ // Для приложения
89 'class' => 'yii\i18n\PhpMessageSource',
90 'sourceLanguage' => 'en-US', // Исходный текст на английском
91 'basePath' => '@app/messages',
94 'app/error' => 'error.php',
97 'contact*' => [ // Для формы обратой связи
98 'class' => 'yii\i18n\PhpMessageSource',
99 'sourceLanguage' => 'en-US',
100 'basePath' => '@app/messages',
102 'app' => 'contact.app',
105 'items*' => [ // Для предметов/оборудования
106 'class' => 'yii\i18n\PhpMessageSource',
107 'sourceLanguage' => 'en-US',
108 'basePath' => '@app/messages',
110 'app' => 'items.app',
113 'locations*' => [ // Для мест размещения
114 'class' => 'yii\i18n\PhpMessageSource',
115 'sourceLanguage' => 'en-US',
116 'basePath' => '@app/messages',
118 'app' => 'locations.app',
121 'moving*' => [ // Для перемещений
122 'class' => 'yii\i18n\PhpMessageSource',
123 'sourceLanguage' => 'en-US',
124 'basePath' => '@app/messages',
126 'app' => 'moving.app',
129 'regions*' => [ // Для регионов/подразделений
130 'class' => 'yii\i18n\PhpMessageSource',
131 'sourceLanguage' => 'en-US',
132 'basePath' => '@app/messages',
134 'app' => 'regions.app',
137 'status*' => [ // Для состояний предметов/оборудования
138 'class' => 'yii\i18n\PhpMessageSource',
139 'sourceLanguage' => 'en-US',
140 'basePath' => '@app/messages',
142 'app' => 'status.app',
145 'types*' => [ // Для типов оборудования
146 'class' => 'yii\i18n\PhpMessageSource',
147 'sourceLanguage' => 'en-US',
148 'basePath' => '@app/messages',
150 'app' => 'types.app',
158 'enablePrettyUrl' => true,
159 'showScriptName' => false,
169 // configuration adjustments for 'dev' environment
170 $config['bootstrap'][] = 'debug';
171 $config['modules']['debug'] = [
172 'class' => 'yii\debug\Module',
173 // uncomment the following to add your IP if you are not connecting from localhost.
174 'allowedIPs' => ['127.0.0.1', '::1', '192.168.0.68'],
177 $config['bootstrap'][] = 'gii';
178 $config['modules']['gii'] = [
179 'class' => 'yii\gii\Module',
180 // uncomment the following to add your IP if you are not connecting from localhost.
181 'allowedIPs' => ['127.0.0.1', '::1', '192.168.0.68'],