https://github.com/makinacorpus/drush-progressbar
Drush progress bar
https://github.com/makinacorpus/drush-progressbar
drupal drush progressbar
Last synced: 9 months ago
JSON representation
Drush progress bar
- Host: GitHub
- URL: https://github.com/makinacorpus/drush-progressbar
- Owner: makinacorpus
- Created: 2016-06-02T09:03:50.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-02T09:12:18.000Z (almost 10 years ago)
- Last Synced: 2025-06-08T07:07:19.256Z (10 months ago)
- Topics: drupal, drush, progressbar
- Language: PHP
- Size: 2.93 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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;
you may do:
```php
$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();
```