@@ -60,6 +60,9 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | + /** |
|
| 64 | + * @param string $url |
|
| 65 | + */ |
|
| 63 | 66 | public function importURL($url) |
| 64 | 67 | { |
| 65 | 68 | $struct = parse_url($url); |
@@ -78,6 +81,11 @@ discard block |
||
| 78 | 81 | } |
| 79 | 82 | |
| 80 | 83 | // utility for __construct |
| 84 | + |
|
| 85 | + /** |
|
| 86 | + * @param string $key |
|
| 87 | + * @param string $default |
|
| 88 | + */ |
|
| 81 | 89 | private static function setOr(array $struct, $key, $default=null) |
| 82 | 90 | { |
| 83 | 91 | if (!empty($struct[$key])) { |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * hirak/prestissimo |
|
| 4 | - * @author Hiraku NAKANO |
|
| 5 | - * @license MIT https://github.com/hirak/prestissimo |
|
| 6 | - */ |
|
| 3 | + * hirak/prestissimo |
|
| 4 | + * @author Hiraku NAKANO |
|
| 5 | + * @license MIT https://github.com/hirak/prestissimo |
|
| 6 | + */ |
|
| 7 | 7 | namespace Hirak\Prestissimo; |
| 8 | 8 | |
| 9 | 9 | /** |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | /** |
| 82 | 82 | * Get the content. |
| 83 | 83 | * |
| 84 | - * @param string $originUrl The origin URL |
|
| 84 | + * @param string $origin The origin URL |
|
| 85 | 85 | * @param string $fileUrl The file URL |
| 86 | 86 | * @param bool $progress Display the progression |
| 87 | 87 | * @param array $options Additional context options |
@@ -101,6 +101,11 @@ discard block |
||
| 101 | 101 | }); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | + /** |
|
| 105 | + * @param string $fileUrl |
|
| 106 | + * @param boolean $progress |
|
| 107 | + * @param \Closure $exec |
|
| 108 | + */ |
|
| 104 | 109 | protected function fetch($origin, $fileUrl, $progress, $options, $exec) |
| 105 | 110 | { |
| 106 | 111 | do { |
@@ -205,11 +210,6 @@ discard block |
||
| 205 | 210 | } |
| 206 | 211 | |
| 207 | 212 | /** |
| 208 | - * @param resource<curl> $ch |
|
| 209 | - * @param int $downBytesMax |
|
| 210 | - * @param int $downBytes |
|
| 211 | - * @param int $upBytesMax |
|
| 212 | - * @param int $upBytes |
|
| 213 | 213 | */ |
| 214 | 214 | public function progress() |
| 215 | 215 | { |
@@ -230,6 +230,9 @@ discard block |
||
| 230 | 230 | return 0; |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | + /** |
|
| 234 | + * @param string $fileName |
|
| 235 | + */ |
|
| 233 | 236 | public static function createFile($fileName) |
| 234 | 237 | { |
| 235 | 238 | if (is_dir($fileName)) { |