Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 678 Bytes

README.md

File metadata and controls

31 lines (20 loc) · 678 Bytes

⏱ PHP CLI Progress Bar

Progress bar for command line PHP scripts.

Example of PHP CLI Progress Bar

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();