library drush-progressbar
Simple progress bar API for Drush
makinacorpus/drush-progressbar
Simple progress bar API for Drush
- Thursday, June 2, 2016
- by pounard
- Repository
- 1 Watchers
- 2 Stars
- 178 Installations
- PHP
- 1 Dependents
- 0 Suggesters
- 1 Forks
- 0 Open issues
- 2 Versions
- 20 % Grown
Drush progress bar API
Usage
Given that:
* you have $total
which is the total number of items to process;
* and $done
is the item count processed so far;, (*1)
you may do:, (*2)
$total = some_count();
$bar = \DrushProgressBar::create();
$bar->start();
$done = 0;
foreach ($items as $item) {
process_item($item);
// Note that here, you could also change the total (yes you can).
$bar->setProgress($total, ++$done);
}
$bar->end();