1 | <?php |
||
9 | class Config { |
||
10 | /** |
||
11 | * @var string 服务名称 |
||
12 | */ |
||
13 | public $bucketName; |
||
14 | /** |
||
15 | * @var string 操作员名 |
||
16 | */ |
||
17 | public $operatorName; |
||
18 | /** |
||
19 | * @var string 操作员密码 md5 hash 值 |
||
20 | */ |
||
21 | public $operatorPassword; |
||
22 | |||
23 | /** |
||
24 | * @var bool 是否使用 https |
||
25 | */ |
||
26 | public $useSsl; |
||
27 | |||
28 | /** |
||
29 | * @var string 上传使用的接口类型,可以设置为 `REST`:使用 rest api 上传,`AUTO` 根据文件大小自动判断,`BLOCK` 使用断点续传 |
||
30 | * 当上传小文件时,不推荐使用断点续传;上传时如果设置了异步预处理`withAsyncProcess=true`,将会使用表单 api 上传 |
||
31 | */ |
||
32 | public $uploadType = 'AUTO'; |
||
33 | |||
34 | /** |
||
35 | * @var int 上传的接口类型设置为 `AUTO` 时,文件大小的边界值:小于该值时,使用 rest api,否则使用断点续传。 默认 30M |
||
36 | */ |
||
37 | public $sizeBoundary = 31457280; |
||
38 | /** |
||
39 | * @var int 分块上传`Multi`接口的最大分块值 |
||
40 | */ |
||
41 | public $maxBlockSize = 5242880; |
||
42 | |||
43 | /** |
||
44 | * @var int 分块时,每个块的过期时间 |
||
45 | */ |
||
46 | public $blockExpiration = 60; |
||
47 | |||
48 | /** |
||
49 | * @var int request timeout seconds |
||
50 | */ |
||
51 | public $timeout = 60; |
||
52 | |||
53 | |||
54 | /** |
||
55 | * @var string 异步云处理的回调通知地址 |
||
56 | */ |
||
57 | public $processNotifyUrl; |
||
58 | |||
59 | private $version = '3.0.0'; |
||
60 | |||
61 | |||
62 | |||
63 | /** |
||
64 | * @var string 表单 api 的秘钥 |
||
65 | */ |
||
66 | private $formApiKey; |
||
67 | |||
68 | /** |
||
69 | * @var string rest api 和 form api 的接口地址 |
||
70 | */ |
||
71 | static $restApiEndPoint; |
||
|
|||
72 | |||
73 | |||
74 | /** |
||
75 | * rest api 和 form api 接口请求地址,详见:http://docs.upyun.com/api/rest_api/ |
||
76 | */ |
||
77 | const ED_AUTO = 'v0.api.upyun.com'; |
||
78 | const ED_TELECOM = 'v1.api.upyun.com'; |
||
79 | const ED_CNC = 'v2.api.upyun.com'; |
||
80 | const ED_CTT = 'v3.api.upyun.com'; |
||
81 | |||
82 | /** |
||
83 | * 分块上传接口请求地址 |
||
84 | */ |
||
85 | const ED_FORM = 'm0.api.upyun.com'; |
||
86 | |||
87 | /** |
||
88 | * 异步云处理接口地址 |
||
89 | */ |
||
90 | const ED_VIDEO = 'p0.api.upyun.com'; |
||
91 | |||
92 | /** |
||
93 | * 刷新接口地址 |
||
94 | */ |
||
95 | const ED_PURGE = 'http://purge.upyun.com/purge/'; |
||
96 | |||
97 | public function __construct($bucketName, $operatorName, $operatorPassword) { |
||
104 | |||
105 | public function setOperatorPassword($operatorPassword) { |
||
108 | |||
109 | public function getFormApiKey() { |
||
116 | |||
117 | public function setFormApiKey($key) { |
||
120 | |||
121 | public function getVersion() { |
||
124 | } |
||
125 |
The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using
the property is implicitly global.
To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.