@@ -27,6 +27,11 @@ public function __construct($client, $contentlength, $source, $minPartSize, $opt
2727 }
2828
2929 public function performUploading () {
30+
31+ $ commands = array ();
32+
33+
34+
3035 $ uploadId = $ this ->initiateMultipartUpload ();
3136 $ offset = 0 ;
3237 $ partNumber = 1 ;
@@ -39,22 +44,39 @@ public function performUploading() {
3944 $ partSize = $ this ->size - $ offset -1 ;
4045 }
4146 //echo ('bytes='.( 'bytes='.((string)$offset).'-'.(string)($offset+$partSize)));
42- $ result = $ this ->client ->UploadPartCopy (array (
43- 'Bucket ' => $ this ->options ['Bucket ' ],
44- 'Key ' => $ this ->options ['Key ' ],
45- 'UploadId ' => $ uploadId ,
46- 'PartNumber ' => $ partNumber ,
47- 'CopySource ' => $ this ->source ,
48- 'CopySourceRange ' => 'bytes= ' .((string )$ offset ).'- ' .(string )($ offset +$ partSize )));
49- $ part = array ('PartNumber ' => $ partNumber , 'ETag ' => $ result ['ETag ' ]);
50- array_push ($ parts , $ part );
47+ $ commands [] = $ this ->client ->getCommand ('UploadPartCopy ' , array (
48+ 'Bucket ' => $ this ->options ['Bucket ' ],
49+ 'Key ' => $ this ->options ['Key ' ],
50+ 'UploadId ' => $ uploadId ,
51+ 'PartNumber ' => $ partNumber ,
52+ 'CopySource ' => $ this ->source ,
53+ 'CopySourceRange ' => 'bytes= ' .((string )$ offset ).'- ' .(string )($ offset +$ partSize ),
54+ ));
55+ // $result = $this->client->UploadPartCopy(array(
56+ // 'Bucket' => $this->options['Bucket'],
57+ // 'Key' => $this->options['Key'],
58+ // 'UploadId' => $uploadId,
59+ // 'PartNumber' => $partNumber,
60+ // 'CopySource'=> $this->source,
61+ // 'CopySourceRange' => 'bytes='.((string)$offset).'-'.(string)($offset+$partSize)));
5162 ++$ partNumber ;
5263 $ offset += $ partSize ;
5364 if ($ this ->size == $ offset +1 )
5465 {
5566 break ;
5667 }
5768 }
69+ $ this ->client ->execute ($ commands );
70+
71+
72+ $ partNumber = 1 ;
73+ foreach ($ commands as $ command ) {
74+
75+ $ result = $ command ->getResult ();
76+ $ part = array ('PartNumber ' => $ partNumber , 'ETag ' => $ result ['ETag ' ]);
77+ array_push ($ parts , $ part );
78+ $ partNumber ++;
79+ }
5880
5981 return $ this ->client ->completeMultipartUpload (array (
6082 'Bucket ' => $ this ->options ['Bucket ' ],
0 commit comments