Skip to content
This repository has been archived by the owner on Jul 28, 2024. It is now read-only.
/ PHP-ProgressBar Public archive
forked from Ex3v/PHP-ProgressBar

PHP command line progress bar that adapts to screen width and shows current ETA.

License

Notifications You must be signed in to change notification settings

nael94/PHP-ProgressBar

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

PHP-ProgressBar

PHP command line progress bar that adapts to screen width and shows current ETA.

Currently tested only on few Linux distributions and OS X. Will probably not work on Windows devices, because calculating console window width differ. Contributions welcome.

USAGE

Initialize progressBar before loop:

$progressBar = new ProgressBar(250);

While in loop, use below code to display current progress:

foreach($items as $i){
        
    echo $progressBar->drawCurrentProgress();

    // actual loop code here
}

You can advance progress to certain step calling:

echo $progressBar->drawCurrentProgress(150); //will display progress as 150 of 250 iterations

Feel free to change anything and send pull requests!

Happy coding.

About

PHP command line progress bar that adapts to screen width and shows current ETA.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%