2017 © Pedro Peláez
 

library progress-cli

A simple progress bar for the php cli

image

floknapp/progress-cli

A simple progress bar for the php cli

  • Thursday, March 23, 2017
  • by FloKnapp
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

progress-cli

A simple progress bar for the php cli, (*1)

Install

composer require floknapp/progress-cli, (*2)

How to use


$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!, (*3)

Further configuration

You can set a custom width:, (*4)

$progress = new Progress($dataset, 80); // set progress bar width to 80 chars

You can show a summary behind the progress bar:, (*5)

$progress = new Progress($dataset, 80, true); // [---------] 100% (250/250)

You can set custom start and end surroundings:, (*6)

$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):, (*7)

$progress = new Progress($dataset);
$progress->setProgressChar('|'); // results in [||||||||||||] 100%

The Versions

23/03 2017

dev-master

9999999-dev

A simple progress bar for the php cli

  Sources   Download

MIT License

The Development Requires

by Florian Knapp