-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb.php
executable file
·124 lines (119 loc) · 4.79 KB
/
web.php
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
<?php
$params = require __DIR__ . '/params.php';
$db = require __DIR__ . '/db.php';
$routes = require(__DIR__ . '/routes.php');
$config = [
'id' => substr($_SERVER['SERVER_NAME'], 0, strpos($_SERVER['SERVER_NAME'], '.')),
'basePath' => dirname(__DIR__),
'timeZone' => 'Europe/Minsk',
'sourceLanguage' => 'en-US',
'language' => 'ru-RU',
'bootstrap' => ['log', 'user_settings', 'site_options'],
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
'modules' => [
'manage' => [
'class' => 'app\modules\manage\ManageModule',
],
],
'components' => [
'reCaptcha' => [
'name' => 'reCaptcha',
'class' => 'himiklab\yii2\recaptcha\ReCaptchaConfig',
//'siteKeyV3' => isset($params['reCaptcha']) && isset($params['reCaptcha']['siteKey']) ? $params['reCaptcha']['siteKey'] : '',
//'secretV3' => isset($params['reCaptcha']) && isset($params['reCaptcha']['secret']) ? $params['reCaptcha']['secret'] : '',
'siteKeyV2' => isset($params['reCaptcha']) && isset($params['reCaptcha']['siteKey']) ? $params['reCaptcha']['siteKey'] : '',
'secretV2' => isset($params['reCaptcha']) && isset($params['reCaptcha']['secret']) ? $params['reCaptcha']['secret'] : '',
],
'robokassa' => [
'class' => '\robokassa\Merchant',
'baseUrl' => 'https://auth.robokassa.ru/Merchant/Index.aspx',
'sMerchantLogin' => isset($params['robokassa']) && isset($params['robokassa']['sMerchantLogin']) ? $params['robokassa']['sMerchantLogin'] : '',
'sMerchantPass1' => isset($params['robokassa']) && isset($params['robokassa']['sMerchantPass1']) ? $params['robokassa']['sMerchantPass1'] : '',
'sMerchantPass2' => isset($params['robokassa']) && isset($params['robokassa']['sMerchantPass2']) ? $params['robokassa']['sMerchantPass2'] : '',
'isTest' => isset($params['robokassa']) && isset($params['robokassa']['isTest']) ? $params['robokassa']['isTest'] : '',
],
'formatter' => [
'defaultTimeZone' => 'Europe/Moscow',
'dateFormat' => 'dd.MM.yyyy',
'datetimeFormat' => 'dd.MM.yyyy HH:mm:ss',
'decimalSeparator' => ',',
'thousandSeparator' => ' ',
'currencyCode' => 'RUR',
],
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => md5(sha1($_SERVER['SERVER_NAME'])),
],
'cache' => [
'class' => 'yii\caching\FileCache',
],
'user' => [
'identityClass' => 'app\models\ActiveRecord\User',
'enableAutoLogin' => true,
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure a transport
// for the mailer to send real emails.
'useFileTransport' => true,
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'db' => $db,
'user_settings' => [
'class' => 'app\components\bootstrap\ActionUserSettings',
],
'site_options' => [
'class' => 'app\components\bootstrap\SiteOptions',
],
'shopcart' => [
'class' => 'app\components\bootstrap\Shopcart',
],
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => $routes,
],
'i18n' => [
'translations' => [
'app*' => [
'class' => 'yii\i18n\PhpMessageSource',
'fileMap' => [
'app' => 'app.php',
],
],
],
],
],
'params' => $params,
];
if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
//'allowedIPs' => ['127.0.0.1', '::1'],
];
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
//'allowedIPs' => ['127.0.0.1', '::1'],
];
}
return $config;