curl_setopt($ch, CURLOPT_RANGE,
$range);
curl_setopt($ch, CURLOPT_URL,
$sourceUri);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false
);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false
);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true
);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true
);
curl_setopt($ch, CURLOPT_NOPROGRESS, false
);
curl_setopt($ch, CURLOPT_PROGRESSFUNCTION,
function D
$ch,
$dltotal,
$dlnow) use ($size) { if ($dlnow > 0
) { $this->
progress($dltotal,
$dlnow,
$size +
$dlnow);
} });
$me =
$this;
$isHalted = false;
$isError = false;
curl_setopt($ch, CURLOPT_WRITEFUNCTION,
function D
$ch,
$str) use ($me,
$partFile, &
$isHalted, &
$isError) { if (curl_getinfo($ch, CURLINFO_HTTP_CODE
) !== 206
) { $isError = true;