Updated method \ncc\Utilities > HttpClient > displayProgress()
This commit is contained in:
parent
7099b02514
commit
344454e8c4
1 changed files with 20 additions and 2 deletions
|
@ -4,6 +4,8 @@
|
|||
|
||||
use CurlHandle;
|
||||
use ncc\Abstracts\HttpRequestType;
|
||||
use ncc\Abstracts\LogLevel;
|
||||
use ncc\CLI\Main;
|
||||
use ncc\Exceptions\HttpException;
|
||||
use ncc\Objects\HttpRequest;
|
||||
use ncc\Objects\HttpResponse;
|
||||
|
@ -176,8 +178,24 @@
|
|||
*/
|
||||
public static function displayProgress($resource, $downloadSize, $downloaded, $uploadSize, $uploaded): void
|
||||
{
|
||||
if(Main::getLogLevel() !== null)
|
||||
{
|
||||
switch(Main::getLogLevel())
|
||||
{
|
||||
case LogLevel::Verbose:
|
||||
case LogLevel::Debug:
|
||||
case LogLevel::Silent:
|
||||
Console::outVerbose(sprintf(' <= %s of %s bytes downloaded', $downloaded, $downloadSize));
|
||||
break;
|
||||
|
||||
default:
|
||||
if ($downloadSize > 0)
|
||||
Console::inlineProgressBar($downloaded, $downloadSize);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue