-
Notifications
You must be signed in to change notification settings - Fork 1
/
Configs.php
108 lines (89 loc) · 1.87 KB
/
Configs.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
<?php
/**
* Class ${NAME}
* Author:huangzhongxi@rockfintech.com
* Date: 2019/5/31 11:13 AM
*/
final class Configs
{
/**
* getAccessKey 七牛上传access_key
* @return string
*/
public function getAccessKey()
{
return 'access';
}
/**
* getSecretKey 七牛上传secret_key
* @return string
*/
public function getSecretKey()
{
return 'secret';
}
/**
* getBackupPath 备份路径
* @return string
*/
public function getBackupPath()
{
return __DIR__.'/storage/backup/';
}
/**
* getBucket 七牛空间名
* @return string
*/
public function getBucket()
{
return 'bucket';
}
/**
* RandomString 获取随机字符
* @param int $length
* @return bool|string
*/
public function RandomString($length=20)
{
$str='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
$random_str=str_shuffle(str_repeat($str,5));
$start_string=mt_rand(0,(strlen($str)-$length));
return substr($random_str,$start_string,$length);
}
/**
* getBackupPath 备份路径
* @return string
*/
public function getLogPath()
{
return __DIR__.'/storage/logs/';
}
public function getKeysPath()
{
return 'database/'.date('Ymd').'/wdblog.sql';
}
public function getUserName()
{
return 'test';
}
public function getPassword()
{
return 'test';
}
public function getDatabaseName()
{
return 'test';
}
public function getSecret()
{
return '1j6ZlOrNqKqNvgHa38AeOyp9HlJ==';
}
public function getCipher()
{
return 'AES-256-CBC';
}
public function getDomain()
{
return 'https://portal.qiniu.com/bucket/wd-http-bucket/index';
}
}