divineomega / php-cli-progress-bar
Progress bar for command line PHP scripts
Fund package maintenance!
DivineOmega
Installs: 102 822
Dependents: 6
Suggesters: 0
Security: 0
Stars: 16
Watchers: 3
Forks: 0
Open Issues: 1
Requires
- php: >=5.6
- khill/php-duration: ^1.0
README
Progress bar for command line PHP scripts.
Installation
To install, just run the following Composer command.
composer require divineomega/php-cli-progress-bar
Usage
The following code snippet shows a basic usage example.
$max = 250; $progressBar = new DivineOmega\CliProgressBar\ProgressBar; $progressBar->setMaxProgress($max); for ($i=0; $i < $max; $i++) { usleep(200000); // Instead of usleep, process a part of your long running task here. $progressBar->advance()->display(); } $progressBar->complete();