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
+10
View File
@@ -1,4 +1,5 @@
<?php
namespace Helper;
use Curl\Curl;
@@ -67,6 +68,15 @@ function create_tmp_file($data)
return $tmp_file;
}
function get_tmp_file_path()
{
// Return temporary file path without creating file.
$tmp_file_path =
rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR) .
DIRECTORY_SEPARATOR . 'php-curl-class.' . uniqid(rand(), true);
return $tmp_file_path;
}
function get_png()
{
$tmp_filename = tempnam('/tmp', 'php-curl-class.');