divineomega/php-cli-progress-bar

This package is abandoned and no longer maintained. The author suggests using the jord-jd/php-cli-progress-bar package instead.

Progress bar for command line PHP scripts

Maintainers

Package info

github.com/Jord-JD/php-cli-progress-bar

pkg:composer/divineomega/php-cli-progress-bar

Transparency log

Fund package maintenance!

DivineOmega

Statistics

Installs: 161 275

Dependents: 1

Suggesters: 0

Stars: 15

Open Issues: 0

v4.1.0 2026-07-18 00:43 UTC

This package is auto-updated.

Last update: 2026-07-18 00:46:18 UTC


README

Progress bar for command line PHP scripts.

Example of PHP CLI Progress Bar

Installation

To install, just run the following Composer command.

composer require jord-jd/php-cli-progress-bar

Usage

The following code snippet shows a basic usage example.

$max = 250;

$progressBar = new JordJD\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();

Calling setMaxProgress() before the first advancement starts the elapsed-time and ETC measurements. If you prepare a progress bar early, call $progressBar->start() immediately before processing to reset those measurements explicitly.