You've already forked cli-progress-bar
Too tired to write descriptive message
This commit is contained in:
25
examples/basicWithShortBar.php
Normal file
25
examples/basicWithShortBar.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use Siteworx\ProgressBar\CliProgressBar;
|
||||
|
||||
require_once('./../vendor/autoload.php');
|
||||
|
||||
$bar = new CliProgressBar(48);
|
||||
$bar->setBarLength(5);
|
||||
$bar->display();
|
||||
|
||||
$bar->setColorToRed();
|
||||
|
||||
while($bar->getCurrentstep() < $bar->getSteps()) {
|
||||
usleep(50000);
|
||||
$bar->progress();
|
||||
|
||||
if ($bar->getCurrentstep() >= ($bar->getSteps() / 2)) {
|
||||
$bar->setColorToYellow();
|
||||
}
|
||||
}
|
||||
|
||||
$bar->setColorToGreen();
|
||||
$bar->display();
|
||||
|
||||
$bar->end();
|
||||
Reference in New Issue
Block a user