mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-22 02:50:52 +00:00
16 lines
434 B
PHP
16 lines
434 B
PHP
<?php
|
|
require '../src/Curl/Curl.php';
|
|
|
|
use \Curl\Curl;
|
|
|
|
$curl = new Curl();
|
|
$curl->progress(function ($client, $download_size, $downloaded, $upload_size, $uploaded){
|
|
if ($download_size === 0) {
|
|
return;
|
|
}
|
|
|
|
$progress = floor( $downloaded * 100 / $download_size );
|
|
echo ' ' . $progress . '%' . "\r";
|
|
});
|
|
$curl->download('https://php.net/distributions/manual/php_manual_en.html.gz', '/tmp/php_manual_en.html.gz');
|