|
77 | 77 | * @method object GetBucketIntelligentTiering (array $arg) |
78 | 78 | */ |
79 | 79 | class Client extends GuzzleClient { |
80 | | - const VERSION = '2.1.3'; |
| 80 | + const VERSION = '2.1.5'; |
81 | 81 |
|
82 | 82 | public $httpClient; |
83 | 83 |
|
@@ -108,7 +108,6 @@ public function __construct($cosConfig) { |
108 | 108 | $this->cosConfig['retry'] = isset($cosConfig['retry']) ? $cosConfig['retry'] : 1; |
109 | 109 | $this->cosConfig['userAgent'] = isset($cosConfig['userAgent']) ? $cosConfig['userAgent'] : 'cos-php-sdk-v5.'. Client::VERSION; |
110 | 110 | $this->cosConfig['pathStyle'] = isset($cosConfig['pathStyle']) ? $cosConfig['pathStyle'] : false; |
111 | | - |
112 | 111 |
|
113 | 112 | $service = Service::getService(); |
114 | 113 | $handler = HandlerStack::create(); |
@@ -229,11 +228,16 @@ private function createPresignedUrl(RequestInterface $request, $expires) { |
229 | 228 | } |
230 | 229 |
|
231 | 230 | public function getPresignetUrl($method, $args, $expires = "+30 minutes") { |
| 231 | + return $this->getPresignedUrl($method, $args, $expires); |
| 232 | + } |
| 233 | + |
| 234 | + public function getPresignedUrl($method, $args, $expires = "+30 minutes") { |
232 | 235 | $command = $this->getCommand($method, $args); |
233 | 236 | $request = $this->commandToRequestTransformer($command); |
234 | 237 | return $this->createPresignedUrl($request, $expires); |
235 | 238 | } |
236 | 239 |
|
| 240 | + |
237 | 241 | public function getObjectUrl($bucket, $key, $expires = "+30 minutes", array $args = array()) { |
238 | 242 | $command = $this->getCommand('GetObject', $args + array('Bucket' => $bucket, 'Key' => $key)); |
239 | 243 | $request = $this->commandToRequestTransformer($command); |
@@ -274,6 +278,13 @@ public function download($bucket, $key, $saveAs, $options = array()) { |
274 | 278 | ) |
275 | 279 | ); |
276 | 280 | $contentLength = $rt['ContentLength']; |
| 281 | + $resumableJson = [ |
| 282 | + 'LastModified' => $rt['LastModified'], |
| 283 | + 'ContentLength' => $rt['ContentLength'], |
| 284 | + 'ETag' => $rt['ETag'], |
| 285 | + 'Crc64ecma' => $rt['Crc64ecma'] |
| 286 | + ]; |
| 287 | + $options['ResumableJson'] = $resumableJson; |
277 | 288 | } catch (\Exception $e) { |
278 | 289 | throw ($e); |
279 | 290 | } |
|
0 commit comments