@@ -2,9 +2,8 @@ |
||
2 | 2 | namespace Qiniu\Storage; |
3 | 3 | |
4 | 4 | use Qiniu\Config; |
5 | -use Qiniu\Http\HttpClient; |
|
6 | -use Qiniu\Storage\ResumeUploader; |
|
7 | 5 | use Qiniu\Storage\FormUploader; |
6 | +use Qiniu\Storage\ResumeUploader; |
|
8 | 7 | |
9 | 8 | /** |
10 | 9 | * 主要涉及了资源上传接口的实现 |
@@ -4,7 +4,6 @@ |
||
4 | 4 | use Qiniu\Config; |
5 | 5 | use Qiniu\Http\Client; |
6 | 6 | use Qiniu\Http\Error; |
7 | -use Qiniu\Processing\Operation; |
|
8 | 7 | |
9 | 8 | /** |
10 | 9 | * 持久化处理类,该类用于主动触发异步持久化操作. |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | * array 辅助方法,无值时不set |
128 | 128 | * |
129 | 129 | * @param $array 待操作array |
130 | - * @param $key key |
|
130 | + * @param string $key key |
|
131 | 131 | * @param $value value 为null时 不设置 |
132 | 132 | * |
133 | 133 | * @return array 原来的array,便于连续操作 |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * |
179 | 179 | * @param string $url 图片链接 |
180 | 180 | * @param string $image 水印图片链接 |
181 | - * @param numeric $dissolve 透明度 |
|
181 | + * @param integer $dissolve 透明度 |
|
182 | 182 | * @param string $gravity 水印位置 |
183 | 183 | * @param numeric $dx 横轴边距 |
184 | 184 | * @param numeric $dy 纵轴边距 |
@@ -210,9 +210,9 @@ discard block |
||
210 | 210 | * @param string $url 图片链接 |
211 | 211 | * @param string $text 文字 |
212 | 212 | * @param string $font 文字字体 |
213 | - * @param string $fontSize 文字字号 |
|
213 | + * @param integer $fontSize 文字字号 |
|
214 | 214 | * @param string $fontColor 文字颜色 |
215 | - * @param numeric $dissolve 透明度 |
|
215 | + * @param integer $dissolve 透明度 |
|
216 | 216 | * @param string $gravity 水印位置 |
217 | 217 | * @param numeric $dx 横轴边距 |
218 | 218 | * @param numeric $dy 纵轴边距 |
@@ -3,7 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use Qiniu\Auth; |
5 | 5 | use Qiniu\Config; |
6 | -use Qiniu\Zone; |
|
7 | 6 | use Qiniu\Http\Client; |
8 | 7 | use Qiniu\Http\Error; |
9 | 8 |
@@ -967,42 +967,63 @@ discard block |
||
967 | 967 | return $scheme . Config::UC_HOST; |
968 | 968 | } |
969 | 969 | |
970 | + /** |
|
971 | + * @param string $body |
|
972 | + */ |
|
970 | 973 | private function rsPost($path, $body = null) |
971 | 974 | { |
972 | 975 | $url = $this->getRsHost() . $path; |
973 | 976 | return $this->post($url, $body); |
974 | 977 | } |
975 | 978 | |
979 | + /** |
|
980 | + * @param string $path |
|
981 | + */ |
|
976 | 982 | private function apiPost($path, $body = null) |
977 | 983 | { |
978 | 984 | $url = $this->getApiHost() . $path; |
979 | 985 | return $this->post($url, $body); |
980 | 986 | } |
981 | 987 | |
988 | + /** |
|
989 | + * @param string $body |
|
990 | + */ |
|
982 | 991 | private function ucPost($path, $body = null) |
983 | 992 | { |
984 | 993 | $url = $this->getUcHost() . $path; |
985 | 994 | return $this->post($url, $body); |
986 | 995 | } |
987 | 996 | |
997 | + /** |
|
998 | + * @param string $path |
|
999 | + */ |
|
988 | 1000 | private function ucGet($path) |
989 | 1001 | { |
990 | 1002 | $url = $this->getUcHost() . $path; |
991 | 1003 | return $this->get($url); |
992 | 1004 | } |
993 | 1005 | |
1006 | + /** |
|
1007 | + * @param string $path |
|
1008 | + */ |
|
994 | 1009 | private function apiGet($path) |
995 | 1010 | { |
996 | 1011 | $url = $this->getApiHost() . $path; |
997 | 1012 | return $this->get($url); |
998 | 1013 | } |
999 | 1014 | |
1015 | + /** |
|
1016 | + * @param string $path |
|
1017 | + */ |
|
1000 | 1018 | private function rsGet($path) |
1001 | 1019 | { |
1002 | 1020 | $url = $this->getRsHost() . $path; |
1003 | 1021 | return $this->get($url); |
1004 | 1022 | } |
1005 | 1023 | |
1024 | + /** |
|
1025 | + * @param string $url |
|
1026 | + */ |
|
1006 | 1027 | private function get($url) |
1007 | 1028 | { |
1008 | 1029 | $headers = $this->auth->authorization($url); |
@@ -1013,6 +1034,9 @@ discard block |
||
1013 | 1034 | return array($ret->json(), null); |
1014 | 1035 | } |
1015 | 1036 | |
1037 | + /** |
|
1038 | + * @param string $url |
|
1039 | + */ |
|
1016 | 1040 | private function post($url, $body) |
1017 | 1041 | { |
1018 | 1042 | $headers = $this->auth->authorization($url, $body, 'application/x-www-form-urlencoded'); |
@@ -1024,18 +1048,28 @@ discard block |
||
1024 | 1048 | return array($r, null); |
1025 | 1049 | } |
1026 | 1050 | |
1051 | + /** |
|
1052 | + * @param string $path |
|
1053 | + * @param string $body |
|
1054 | + */ |
|
1027 | 1055 | private function ucPostV2($path, $body) |
1028 | 1056 | { |
1029 | 1057 | $url = $this->getUcHost() . $path; |
1030 | 1058 | return $this->postV2($url, $body); |
1031 | 1059 | } |
1032 | 1060 | |
1061 | + /** |
|
1062 | + * @param string $path |
|
1063 | + */ |
|
1033 | 1064 | private function rsPostV2($path, $body) |
1034 | 1065 | { |
1035 | 1066 | $url = $this->getRsHost() . $path; |
1036 | 1067 | return $this->postV2($url, $body); |
1037 | 1068 | } |
1038 | 1069 | |
1070 | + /** |
|
1071 | + * @param string $url |
|
1072 | + */ |
|
1039 | 1073 | private function postV2($url, $body) |
1040 | 1074 | { |
1041 | 1075 | $headers = $this->auth->authorizationV2($url, 'POST', $body, 'application/json'); |
@@ -1104,6 +1138,9 @@ discard block |
||
1104 | 1138 | return $data; |
1105 | 1139 | } |
1106 | 1140 | |
1141 | + /** |
|
1142 | + * @param string $operation |
|
1143 | + */ |
|
1107 | 1144 | private static function oneKeyBatch($operation, $bucket, $keys) |
1108 | 1145 | { |
1109 | 1146 | $data = array(); |
@@ -1113,6 +1150,9 @@ discard block |
||
1113 | 1150 | return $data; |
1114 | 1151 | } |
1115 | 1152 | |
1153 | + /** |
|
1154 | + * @param string $operation |
|
1155 | + */ |
|
1116 | 1156 | private static function twoKeyBatch($operation, $source_bucket, $key_pairs, $target_bucket, $force) |
1117 | 1157 | { |
1118 | 1158 | if ($target_bucket === null) { |
@@ -30,10 +30,11 @@ discard block |
||
30 | 30 | * |
31 | 31 | * @param $upToken 上传凭证 |
32 | 32 | * @param $key 上传文件名 |
33 | - * @param $inputStream 上传二进制流 |
|
33 | + * @param resource $inputStream 上传二进制流 |
|
34 | 34 | * @param $size 上传流的大小 |
35 | 35 | * @param $params 自定义变量 |
36 | - * @param $mime 上传数据的mimeType |
|
36 | + * @param string $mime 上传数据的mimeType |
|
37 | + * @param Config $config |
|
37 | 38 | * |
38 | 39 | * @link http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar |
39 | 40 | */ |
@@ -70,6 +71,7 @@ discard block |
||
70 | 71 | |
71 | 72 | /** |
72 | 73 | * 上传操作 |
74 | + * @param string $fname |
|
73 | 75 | */ |
74 | 76 | public function upload($fname) |
75 | 77 | { |
@@ -111,6 +113,7 @@ discard block |
||
111 | 113 | |
112 | 114 | /** |
113 | 115 | * 创建块 |
116 | + * @param string $block |
|
114 | 117 | */ |
115 | 118 | private function makeBlock($block, $blockSize) |
116 | 119 | { |
@@ -152,6 +155,9 @@ discard block |
||
152 | 155 | return array($response->json(), null); |
153 | 156 | } |
154 | 157 | |
158 | + /** |
|
159 | + * @param string $url |
|
160 | + */ |
|
155 | 161 | private function post($url, $data) |
156 | 162 | { |
157 | 163 | $this->currentUrl = $url; |
@@ -159,6 +165,9 @@ discard block |
||
159 | 165 | return Client::post($url, $data, $headers); |
160 | 166 | } |
161 | 167 | |
168 | + /** |
|
169 | + * @param integer $uploaded |
|
170 | + */ |
|
162 | 171 | private function blockSize($uploaded) |
163 | 172 | { |
164 | 173 | if ($this->size < $uploaded + Config::BLOCK_SIZE) { |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Qiniu\Rtc; |
3 | 3 | |
4 | +use Qiniu\Auth; |
|
5 | +use Qiniu\Config; |
|
4 | 6 | use Qiniu\Http\Client; |
5 | 7 | use Qiniu\Http\Error; |
6 | -use Qiniu\Config; |
|
7 | -use Qiniu\Auth; |
|
8 | 8 | |
9 | 9 | class AppClient |
10 | 10 | { |
@@ -168,6 +168,9 @@ discard block |
||
168 | 168 | return $this->auth->signWithData($appAccessString); |
169 | 169 | } |
170 | 170 | |
171 | + /** |
|
172 | + * @param string $url |
|
173 | + */ |
|
171 | 174 | private function get($url, $cType = null) |
172 | 175 | { |
173 | 176 | $rtcToken = $this->auth->authorizationV2($url, "GET", null, $cType); |
@@ -179,6 +182,9 @@ discard block |
||
179 | 182 | return array($ret->json(), null); |
180 | 183 | } |
181 | 184 | |
185 | + /** |
|
186 | + * @param string $url |
|
187 | + */ |
|
182 | 188 | private function delete($url, $contentType = 'application/json') |
183 | 189 | { |
184 | 190 | $rtcToken = $this->auth->authorizationV2($url, "DELETE", null, $contentType); |
@@ -190,6 +196,10 @@ discard block |
||
190 | 196 | return array($ret->json(), null); |
191 | 197 | } |
192 | 198 | |
199 | + /** |
|
200 | + * @param string $url |
|
201 | + * @param string $body |
|
202 | + */ |
|
193 | 203 | private function post($url, $body, $contentType = 'application/json') |
194 | 204 | { |
195 | 205 | $rtcToken = $this->auth->authorizationV2($url, "POST", $body, $contentType); |
@@ -52,12 +52,18 @@ |
||
52 | 52 | return $scheme . Config::ARGUS_HOST; |
53 | 53 | } |
54 | 54 | |
55 | + /** |
|
56 | + * @param string $path |
|
57 | + */ |
|
55 | 58 | private function arPost($path, $body = null) |
56 | 59 | { |
57 | 60 | $url = $this->getArHost() . $path; |
58 | 61 | return $this->post($url, $body); |
59 | 62 | } |
60 | 63 | |
64 | + /** |
|
65 | + * @param string $url |
|
66 | + */ |
|
61 | 67 | private function post($url, $body) |
62 | 68 | { |
63 | 69 | $headers = $this->auth->authorizationV2($url, 'POST', $body, 'application/json'); |
@@ -3,7 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use Qiniu\Auth; |
5 | 5 | use Qiniu\Config; |
6 | -use Qiniu\Zone; |
|
7 | 6 | use Qiniu\Http\Client; |
8 | 7 | use Qiniu\Http\Error; |
9 | 8 |
@@ -21,6 +21,10 @@ |
||
21 | 21 | public $iovipHost; |
22 | 22 | |
23 | 23 | //构造一个Region对象 |
24 | + |
|
25 | + /** |
|
26 | + * @param string $iovipHost |
|
27 | + */ |
|
24 | 28 | public function __construct( |
25 | 29 | $srcUpHosts = array(), |
26 | 30 | $cdnUpHosts = array(), |
@@ -236,6 +236,9 @@ discard block |
||
236 | 236 | return $img_base64; |
237 | 237 | } |
238 | 238 | |
239 | + /** |
|
240 | + * @param string $url |
|
241 | + */ |
|
239 | 242 | private function get($url, $cType = null) |
240 | 243 | { |
241 | 244 | $rtcToken = $this->auth->authorizationV2($url, "GET", null, $cType); |
@@ -247,6 +250,9 @@ discard block |
||
247 | 250 | return array($ret->json(), null); |
248 | 251 | } |
249 | 252 | |
253 | + /** |
|
254 | + * @param string $url |
|
255 | + */ |
|
250 | 256 | private function delete($url, $contentType = 'application/json') |
251 | 257 | { |
252 | 258 | $rtcToken = $this->auth->authorizationV2($url, "DELETE", null, $contentType); |
@@ -258,6 +264,10 @@ discard block |
||
258 | 264 | return array($ret->json(), null); |
259 | 265 | } |
260 | 266 | |
267 | + /** |
|
268 | + * @param string $url |
|
269 | + * @param string $body |
|
270 | + */ |
|
261 | 271 | private function post($url, $body, $contentType = 'application/json') |
262 | 272 | { |
263 | 273 | $rtcToken = $this->auth->authorizationV2($url, "POST", $body, $contentType); |
@@ -269,6 +279,11 @@ discard block |
||
269 | 279 | $r = ($ret->body === null) ? array() : $ret->json(); |
270 | 280 | return array($r, null); |
271 | 281 | } |
282 | + |
|
283 | + /** |
|
284 | + * @param string $url |
|
285 | + * @param string $body |
|
286 | + */ |
|
272 | 287 | private function PUT($url, $body, $contentType = 'application/json') |
273 | 288 | { |
274 | 289 | $rtcToken = $this->auth->authorizationV2($url, "PUT", $body, $contentType); |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace Qiniu\Sms; |
3 | 3 | |
4 | +use Qiniu\Auth; |
|
5 | +use Qiniu\Config; |
|
4 | 6 | use Qiniu\Http\Client; |
5 | 7 | use Qiniu\Http\Error; |
6 | -use Qiniu\Config; |
|
7 | -use Qiniu\Auth; |
|
8 | 8 | |
9 | 9 | class Sms |
10 | 10 | { |