Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/divineomega/php-cli-progress-bar

⏱️ Progress bar for command line PHP scripts
https://github.com/divineomega/php-cli-progress-bar

command-line php php-library progress-bar

Last synced: 3 months ago
JSON representation

⏱️ Progress bar for command line PHP scripts

Awesome Lists containing this project

README

        

# ⏱ 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.

```php
$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();
```