guiguiboy / php-cli-progress-bar Goto Github PK
View Code? Open in Web Editor NEWA PHP5 CLI Progress bar
A PHP5 CLI Progress bar
Il faudrait clarifier la licence sous laquelle est distribué la librairie (dans le composer.json et/ou le README.md).
En l'état actuel des choses, je ne sais pas si je peux l'utiliser dans une application sous licence GPL.
Hey guys,
Thanks for the awesome work. Is there the possibility of fixing a stable version?
Thanks,
For each progress bar I need to track the loop counter in order to update it.
$loop = 0;
$progress = new \ProgressBar\Manager(0, count($array));
foreach($array as $element){
// do something with $element
$progress->update(++$loop);
}
Wouldn't it be better to have an increment()
or advance()
method to do this operation?
$progress = new \ProgressBar\Manager(0, count($array));
foreach($array as $element){
// do something with $element
$progress->advance();
}
You should add a require for the mbstring extension in the composer.json file
Hello,
To help the author with this todo ("ask developpers for feedback"). Use this class carefully because it can increase (a lot) the execution time in a very big loop !
Use a modulo to not update every iteration.
Would be a nice feature to add
Ajouter un tag permettrait de cibler plus précisément la version voulue dans notre composer.json (au lieu de cibler en dur le hash du dernier commit)
Hi, great library!
I'm using it in an API context where the destination environment is requesting data from API in batches of 200 data pieces. The problem is after the first batch of 200 is processed, the next batch is requested and either the ETA is really high and decreases or it starts from 0 and increases towards the initial ETA of the first batch, depending on:
Can you please help in this regard? Am I missing something from the library that I haven't used?
We should be able to set a custom message somewhere,
like downloading file1 when it finishes, we say downloading file2 or executing 1/20 queries, executing 2/20 queries etc
update() only accepts integers while outputting progress bar uses number_format($percent,2) which gives it two decimal places.
I don't know how possible this would be but I'd like for this package to integrate with the the windows taskbar progress indicator.
What license is this under? BSD, MIT?
Please make a release of your library for not to add dev-master
as version constraint to composer.json dependency.
If I init the progress bar with a number higher than 0, e.g.
$progressBar = new \ProgressBar\Manager(1, 10);
php throws a notice because in Manager.php Line 109 there is an access to key 0
$initialTime = $advancement[0];
$pb = new ProgressBar();
addEtaToProgressBar($pb);
$pb->setFormat('%current%/%max% %elapsed% [%bar%] %percent%% %eta%');
function addEtaToProgressBar(ProgressBar &$progressBar)
{
$registry = $progressBar->getRegistry();
$registry->setValue('startTime', time());
$progressBar->addReplacementRule(
'%elapsed%',
40,
function ($buffer, $registry) {
/** @var \ProgressBar\Registry $registry */
$elapsed = time() - $registry->getValue('startTime');
$hoursCount = intval($elapsed / 3600);
$rest = ($elapsed % 3600);
$minutesCount = intval($rest / 60);
$secondsCount = ($rest % 60);
return sprintf("%02d:%02d:%02d", $hoursCount, $minutesCount, $secondsCount);
}
);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.