Skip to content

Commit fee843b

Browse files
authored
fix copy (#47)
1 parent ebb93ad commit fee843b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Qcloud/Cos/Client.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,11 @@ public function copy($bucket, $key, $copysource, $options = array()) {
130130
$options = Collection::fromConfig(array_change_key_case($options), array(
131131
'min_part_size' => Copy::MIN_PART_SIZE,
132132
'params' => $options));
133-
$sourcebucket = explode('-',explode('.',$copysource)[0])[0];
134-
$sourceappid = explode('-',explode('.',$copysource)[0])[1];
135-
$sourceregion = explode('.',$copysource)[2];
133+
$sourcelistdot = explode('.',$copysource);
134+
$sourcelistline = explode('-',$sourcelistdot[0]);
135+
$sourcebucket = $sourcelistline[0];
136+
$sourceappid = $sourcelistline[1];
137+
$sourceregion = $sourcelistdot[2];
136138
$sourcekey = substr(strstr($copysource,'/'),1);
137139
$sourceversion = "";
138140
$cosClient = new Client(array('region' => $sourceregion,

0 commit comments

Comments
 (0)