Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/floknapp/progress-cli
A simple progress bar for the php cli
https://github.com/floknapp/progress-cli
bar php-cli progress progress-cli progressbar
Last synced: about 1 month ago
JSON representation
A simple progress bar for the php cli
- Host: GitHub
- URL: https://github.com/floknapp/progress-cli
- Owner: FloKnapp
- License: mit
- Created: 2017-03-23T16:42:45.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-23T18:16:59.000Z (almost 8 years ago)
- Last Synced: 2024-04-24T08:26:36.331Z (8 months ago)
- Topics: bar, php-cli, progress, progress-cli, progressbar
- Language: PHP
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# progress-cli
A simple progress bar for the php cli# Install
composer require floknapp/progress-cli# How to use
```php$dataset = ['entry1', 'entry2', ...]; // everything that is countable
$progress = new Progress($dataset); // default progress bar width is 40 chars
for ($i=0; $i < count($dataset); $i++) { // yea yea, i know... no count in for parameters
[... do things]
$progress->update($i);
}
```
That's it!# Further configuration
You can set a custom width:
```php
$progress = new Progress($dataset, 80); // set progress bar width to 80 chars
```You can show a summary behind the progress bar:
```php
$progress = new Progress($dataset, 80, true); // [---------] 100% (250/250)
```You can set custom start and end surroundings:
```php
$progress = new Progress($dataset);
$progress->setProgressLimiter('(', ')'); // results in (---------) 100%
```You can set a custom progress char (currently only 1 byte chars, no enhanced utf-8 chars supported):
```php
$progress = new Progress($dataset);
$progress->setProgressChar('|'); // results in [||||||||||||] 100%
```