Fix #405: Support resume for Curl::download()

This commit is contained in:
Zach Borboa
2016-11-10 20:34:18 -08:00
parent d2313c0294
commit 5cb05e956a
6 changed files with 224 additions and 1 deletions
+7
View File
@@ -1,4 +1,7 @@
<?php
require_once 'ContentRangeServer.php';
require_once 'RangeHeader.php';
require_once 'Helper.php';
use \Helper\Test;
@@ -257,6 +260,10 @@ if ($test === 'http_basic_auth') {
header('ETag: ' . md5($str));
echo $str;
exit;
} elseif ($test === 'download_file_range') {
$unsafe_file_path = $_GET['file_path'];
(new ContentRangeServer\ContentRangeServer())->serve($unsafe_file_path);
exit;
} elseif ($test === 'timeout') {
$unsafe_seconds = $_GET['seconds'];
$start = time();