makinacorpus / drush-progressbar
Drush的简单进度条API
1.0.0
2016-06-02 09:15 UTC
Requires (Dev)
- phpunit/phpunit: ^5.1
This package is auto-updated.
Last update: 2024-09-10 21:36:05 UTC
README
使用方法
假设
- 你有
$total
,表示要处理的物品总数; - 并且
$done
是到目前为止已处理的物品数量;
你可以这样做:
$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();