Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/divineomega/php-cli-progress-bar
- Owner: DivineOmega
- License: gpl-3.0
- Created: 2018-04-20T13:19:29.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-02-06T22:00:07.000Z (almost 5 years ago)
- Last Synced: 2024-10-15T02:37:42.246Z (3 months ago)
- Topics: command-line, php, php-library, progress-bar
- Language: PHP
- Homepage:
- Size: 173 KB
- Stars: 16
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ⏱ PHP CLI Progress Bar
Progress bar for command line PHP scripts.
## 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();
```