forked from kuafuRace/phprap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb.php
More file actions
executable file
·110 lines (102 loc) · 3.58 KB
/
Copy pathweb.php
File metadata and controls
executable file
·110 lines (102 loc) · 3.58 KB
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
<?php
$params = require __DIR__ . '/params.php';
$db = require __DIR__ . '/db.php';
$config = [
'id' => 'basic',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
'charset' => 'utf-8',
'language' => 'zh-CN',
'timeZone' => 'Asia/Shanghai',
'components' => [
'request' => [
'cookieValidationKey' => 'cookie-phprap',
'csrfParam' => 'csrf-phprap',
],
'cache' => [
'class' => 'yii\caching\FileCache',
],
'user' => [
'identityClass' => 'app\models\Account',
'enableAutoLogin' => true,
'identityCookie' => ['name' => 'identity-phprap', 'httpOnly' => true],
'loginUrl'=>['account/login']
],
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'useFileTransport' =>false,//这句一定有,false发送邮件,true只是生成邮件在runtime文件夹下,不发邮件
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.qq.com', //每种邮箱的host配置不一样
'username' => '245629560@qq.com',
'password' => 'lei19880805',
'port' => '465',
'encryption' => 'ssl',
],
'messageConfig'=>[
'charset'=>'UTF-8',
'from' => ['245629560@qq.com'=>'招财猫数据推送失败通知']
],
],
'view' => [
'defaultExtension' => 'html',
'renderers' => [
'html' => [
'class' => 'yii\smarty\ViewRenderer',
'cachePath' => '@runtime/smarty/cache',
'compilePath' => '@runtime/smarty/compile',
'options' => [
'left_delimiter' => '{{',
'right_delimiter' => '}}',
],
'pluginDirs' => ['@app/plugins/smarty'],
],
],
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'db' => $db,
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'suffix' => '.html',
'rules' => [
'/' => '/home/site/index',
'/project/<id:\d+>' => 'home/project/show',
'/member/<id:\d+>' => 'home/member/show',
'/api/<id:\d+>' => 'home/api/show',
'/admin/home' => '/admin/home/index',
"<controller:\w+>/<action:\w+>"=>"home/<controller>/<action>",
],
],
],
'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' => ['*'],
];
$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' => ['*'],
// 'allowedIPs' => ['101.200.46.207', '::1', '192.168.200.106'],
];
}
return $config;