PHP Classes

PHP CLI Progress Bar: Show a progress bar in a console terminal

Recommend this page to a friend!
  Info   View files Example   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 73 All time: 10,084 This week: 190Up
Version License PHP version Categories
php_component_cli_pr 1.0GNU Lesser Genera...5PHP 5, Utilities and Tools, Console


Stev Leibelt


This class can show a progress bar in a console terminal.

It can display a progress bar in a way that it shows the number of steps that were performed for a task divided in given number of smaller tasks.

The class can advance to the next step until all the steps are done and it updates the ways the progress bar appears to reflect the proportion of steps that were done compared to the total number steps.

Picture of nvb
  Performance   Level  
Name: nvb <contact>
Classes: 20 packages by
Country: Germany Germany
Age: ???
All time rank: 151495 in Germany Germany
Week rank: 70 Up4 in Germany Germany Up
Innovation award
Innovation award
Nominee: 12x

Winner: 1x


Progress Bar for PHP CLI Scripts / Shell Environment

This project aims to deliver a easy to use php component for displaying a progress bar in the shell environment.

The current change log can be found here.


//assuming $items contains an array of items
$progressBar = new \Net\Bazzline\Component\Cli\ProgressBar\ProgressBar();


foreach ($items as $item) {
    //do something with the item
//to be on the save side, tell the progress bar that the show is over ;-)


cd <project root>

| Example of the progress bar |
This demo will demonstrate 5 progress bars.
The number of items will be 3, 6, 9, 12, 150.
The current update interval is 1 second.

Press CTRL-C to stop this demonstration


Links (other good projects)


Final Words

Star it if you like it :-). Add issues if you need it. Pull patches if you enjoy it. Write a blog entry if you use it :-D.

  Files folder image Files  
File Role Description
Files folder imageexample (1 file)
Files folder imagesource (1 file)
Accessible without login Plain text file .scrutinizer.yml Data Auxiliary data
Accessible without login Plain text file Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file Doc. Documentation

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file run.php Example Example script

  Files folder image Files  /  source  
File Role Description
  Plain text file ProgressBar.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:10,084
This week:190Up