Last active
October 16, 2015 08:35
-
-
Save eSlider/dbacdb4e867f67798a95 to your computer and use it in GitHub Desktop.
Progress example command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** @var ProgressHelper $progress */ | |
| $progress = clone $this->getHelper('progress'); | |
| $progress->setFormat(' %current%/%max% [%bar%] %percent%% Elapsed: %elapsed%'); | |
| $progress->setBarCharacter('<info>∎</info>'); | |
| $progress->setEmptyBarCharacter(' '); | |
| $progress->setBarWidth(100); | |
| $progress->setProgressCharacter("∎"); | |
| $count = rand(0, 1000); | |
| $progress->start($output, $count); | |
| for ($i = 0; $i < $count; $i++) { | |
| usleep(20000); | |
| $progress->advance(); | |
| } | |
| $progress->finish(); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment