2017 © Pedro Peláez
 

library php-cli-tools

Console utilities for PHP

image

wp-cli/php-cli-tools

Console utilities for PHP

  • Friday, April 20, 2018
  • by danielbachhuber
  • Repository
  • 30 Watchers
  • 566 Stars
  • 1,602,416 Installations
  • PHP
  • 77 Dependents
  • 1 Suggesters
  • 95 Forks
  • 2 Open issues
  • 25 Versions
  • 6 % Grown

The README.md

PHP Command Line Tools

A collection of functions and classes to assist with command line development., (*1)

Requirements, (*2)

  • PHP >= 5.6

Suggested PHP extensions, (*3)

  • mbstring - Used for calculating string widths.

Function List

  • cli\out($msg, ...)
  • cli\out_padded($msg, ...)
  • cli\err($msg, ...)
  • cli\line($msg = '', ...)
  • cli\input()
  • cli\prompt($question, $default = false, $marker = ':')
  • cli\choose($question, $choices = 'yn', $default = 'n')
  • cli\menu($items, $default = false, $title = 'Choose an Item')

Progress Indicators

  • cli\notify\Dots($msg, $dots = 3, $interval = 100)
  • cli\notify\Spinner($msg, $interval = 100)
  • cli\progress\Bar($msg, $total, $interval = 100)

Tabular Display

  • cli\Table::__construct(array $headers = null, array $rows = null)
  • cli\Table::setHeaders(array $headers)
  • cli\Table::setRows(array $rows)
  • cli\Table::setRenderer(cli\table\Renderer $renderer)
  • cli\Table::addRow(array $row)
  • cli\Table::sort($column)
  • cli\Table::display()

The display function will detect if output is piped and, if it is, render a tab delimited table instead of the ASCII table rendered for visual display., (*4)

You can also explicitly set the renderer used by calling cli\Table::setRenderer() and giving it an instance of one of the concrete cli\table\Renderer classes., (*5)

Tree Display

  • cli\Tree::__construct()
  • cli\Tree::setData(array $data)
  • cli\Tree::setRenderer(cli\tree\Renderer $renderer)
  • cli\Tree::render()
  • cli\Tree::display()

Argument Parser

Argument parsing uses a simple framework for taking a list of command line arguments, usually straight from $_SERVER['argv'], and parses the input against a set of defined rules., (*6)

Check examples/arguments.php for an example., (*7)

Usage

See examples/ directory for examples., (*8)

Todo

  • Expand this README
  • Add doc blocks to rest of code

The Versions

20/04 2018

dev-master

9999999-dev http://github.com/wp-cli/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

20/04 2018

v0.11.9

0.11.9.0 http://github.com/wp-cli/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

12/10 2017

v0.11.8

0.11.8.0 http://github.com/wp-cli/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

02/10 2017

v0.11.7

0.11.7.0 http://github.com/wp-cli/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

04/08 2017

v0.11.6

0.11.6.0 http://github.com/wp-cli/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

26/07 2017

v0.11.5

0.11.5.0 http://github.com/wp-cli/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

25/07 2017

v0.11.4

0.11.4.0 http://github.com/wp-cli/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

08/06 2017

v0.11.3

0.11.3.0 http://github.com/wp-cli/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

15/02 2017

v0.11.2

0.11.2.0 http://github.com/wp-cli/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

08/02 2016

v0.11.1

0.11.1.0 http://github.com/wp-cli/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

01/01 2016

v0.11.0

0.11.0.0 http://github.com/wp-cli/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

10/08 2015

v0.10.5

0.10.5.0 http://github.com/wp-cli/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

27/02 2015

v0.10.4

0.10.4.0 http://github.com/wp-cli/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

03/12 2014

v0.10.3

0.10.3.0 http://github.com/wp-cli/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

12/11 2014

v0.10.2

0.10.2.0 http://github.com/wp-cli/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

10/09 2014

v0.10.1

0.10.1.0 http://github.com/wp-cli/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

07/09 2014

v0.10.0

0.10.0.0 http://github.com/wp-cli/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

29/06 2014

v0.9.5

0.9.5.0 http://github.com/wp-cli/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

02/02 2014

v0.9.4-patch46

0.9.4.0-patch46 http://github.com/jlogsdon/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

17/06 2013

v0.9.4

0.9.4.0 http://github.com/jlogsdon/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

14/06 2013

v0.9.3

0.9.3.0 http://github.com/jlogsdon/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

12/06 2013

v0.9.2

0.9.2.0 http://github.com/jlogsdon/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

12/04 2013

v0.9.1.1

0.9.1.1 http://github.com/jlogsdon/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

15/09 2012

v0.9.1

0.9.1.0 http://github.com/jlogsdon/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli

15/08 2012

v0.9

0.9.0.0 http://github.com/jlogsdon/php-cli-tools

Console utilities for PHP

  Sources   Download

MIT

The Requires

  • php >= 5.3.0

 

console cli