makinacorpus / drush-progressbar
Simple progress bar API for Drush
Installs: 1 318
Dependents: 1
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 1
Open Issues: 1
Requires (Dev)
- phpunit/phpunit: ^5.1
This package is auto-updated.
Last update: 2024-11-10 22:04:43 UTC
README
Usage
Given that:
- you have
$total
which is the total number of items to process; - and
$done
is the item count processed so far;
you may do:
$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();