@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
42 | - * @return mixed |
|
42 | + * @return string |
|
43 | 43 | */ |
44 | 44 | public function getBucket() |
45 | 45 | { |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
50 | - * @param $path |
|
50 | + * @param string $path |
|
51 | 51 | * |
52 | 52 | * @return string |
53 | 53 | */ |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | } |
345 | 345 | |
346 | 346 | /** |
347 | - * @param $content |
|
347 | + * @param string $content |
|
348 | 348 | * |
349 | 349 | * @return bool|string |
350 | 350 | */ |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | } |
361 | 361 | |
362 | 362 | /** |
363 | - * @param $tmpfname |
|
363 | + * @param boolean|string $tmpfname |
|
364 | 364 | */ |
365 | 365 | private function deleteTempFile($tmpfname) |
366 | 366 | { |
@@ -31,8 +31,8 @@ |
||
31 | 31 | /** |
32 | 32 | * 生成单次有效签名函数(用于删除和更新指定fileId资源,使用一次即失效). |
33 | 33 | * |
34 | - * @param string $fileId 文件路径,以 /{$appId}/{$bucketName} 开头 |
|
35 | 34 | * @param string $bucketName 文件所在bucket |
35 | + * @param string $path |
|
36 | 36 | * |
37 | 37 | * @return string 签名 |
38 | 38 | */ |
@@ -197,6 +197,10 @@ discard block |
||
197 | 197 | * 'Content-Language' => '*' |
198 | 198 | * 'x-cos-meta-自定义内容' => '*' |
199 | 199 | */ |
200 | + |
|
201 | + /** |
|
202 | + * @param string $authority |
|
203 | + */ |
|
200 | 204 | public static function update($bucketName, $path, |
201 | 205 | $bizAttr = null, $authority = null, $customer_headers_array = null) |
202 | 206 | { |
@@ -866,8 +870,8 @@ discard block |
||
866 | 870 | /** |
867 | 871 | * 判断pattern值是否正确. |
868 | 872 | * |
869 | - * @param string $authority |
|
870 | 873 | * |
874 | + * @param string $pattern |
|
871 | 875 | * @return [type] bool |
872 | 876 | */ |
873 | 877 | private static function isPatternValid($pattern) |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @return [type] [description] |
54 | 54 | */ |
55 | 55 | public static function upload($bucketName, $srcPath, $dstPath, |
56 | - $bizAttr = null, $slicesize = null, $insertOnly = null) |
|
56 | + $bizAttr = null, $slicesize = null, $insertOnly = null) |
|
57 | 57 | { |
58 | 58 | if (!file_exists($srcPath)) { |
59 | 59 | return [ |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | return self::updateBase($bucketName, $path, $bizAttr); |
161 | 161 | } |
162 | 162 | |
163 | - /* |
|
163 | + /* |
|
164 | 164 | * 查询目录信息 |
165 | 165 | * @param string $bucketName bucket名称 |
166 | 166 | * @param string $path 目录路径 |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * 'x-cos-meta-自定义内容' => '*' |
199 | 199 | */ |
200 | 200 | public static function update($bucketName, $path, |
201 | - $bizAttr = null, $authority = null, $customer_headers_array = null) |
|
201 | + $bizAttr = null, $authority = null, $customer_headers_array = null) |
|
202 | 202 | { |
203 | 203 | $path = self::normalizerPath($path); |
204 | 204 | |
@@ -283,9 +283,9 @@ discard block |
||
283 | 283 | |
284 | 284 | if (filesize($srcPath) >= self::MAX_UNSLICE_FILE_SIZE) { |
285 | 285 | return [ |
286 | - 'code' => self::COSAPI_PARAMS_ERROR, |
|
287 | - 'message' => 'file '.$srcPath.' larger then 20M, please use upload_slice interface', |
|
288 | - 'data' => [], ]; |
|
286 | + 'code' => self::COSAPI_PARAMS_ERROR, |
|
287 | + 'message' => 'file '.$srcPath.' larger then 20M, please use upload_slice interface', |
|
288 | + 'data' => [], ]; |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | $expired = time() + self::EXPIRED_SECONDS; |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | * 'x-cos-meta-自定义内容' => '*' |
625 | 625 | */ |
626 | 626 | private static function updateBase($bucketName, $path, |
627 | - $bizAttr = null, $authority = null, $custom_headers_array = null) |
|
627 | + $bizAttr = null, $authority = null, $custom_headers_array = null) |
|
628 | 628 | { |
629 | 629 | $path = self::cosUrlEncode($path); |
630 | 630 | $expired = time() + self::EXPIRED_SECONDS; |
@@ -30,9 +30,9 @@ |
||
30 | 30 | }); |
31 | 31 | |
32 | 32 | Storage::disk('cosv3') |
33 | - ->addPlugin(new PutRemoteFile()) |
|
34 | - ->addPlugin(new PutRemoteFileAs()) |
|
35 | - ->addPlugin(new GetUrl()); |
|
33 | + ->addPlugin(new PutRemoteFile()) |
|
34 | + ->addPlugin(new PutRemoteFileAs()) |
|
35 | + ->addPlugin(new GetUrl()); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -25,7 +25,7 @@ |
||
25 | 25 | __DIR__.'/filesystems.php' => config_path('filesystems.php'), |
26 | 26 | ]); |
27 | 27 | |
28 | - Storage::extend('cosv3', function ($app, $config) { |
|
28 | + Storage::extend('cosv3', function($app, $config) { |
|
29 | 29 | return new Filesystem(new Adapter($config)); |
30 | 30 | }); |
31 | 31 |
@@ -78,8 +78,8 @@ |
||
78 | 78 | curl_setopt(self::$_curlHandler, CURLOPT_SSLVERSION, 4); |
79 | 79 | } |
80 | 80 | } elseif ($ssl) { |
81 | - curl_setopt(self::$_curlHandler, CURLOPT_SSL_VERIFYPEER, false); //true any ca |
|
82 | - curl_setopt(self::$_curlHandler, CURLOPT_SSL_VERIFYHOST, 1); //check only host |
|
81 | + curl_setopt(self::$_curlHandler, CURLOPT_SSL_VERIFYPEER, false); //true any ca |
|
82 | + curl_setopt(self::$_curlHandler, CURLOPT_SSL_VERIFYHOST, 1); //check only host |
|
83 | 83 | if (isset($rq['ssl_version'])) { |
84 | 84 | curl_setopt(self::$_curlHandler, CURLOPT_SSLVERSION, $rq['ssl_version']); |
85 | 85 | } else { |