2017 © Pedro Peláez
 

library cliphf

PHP Cli Formatting library.

image

hvolschenk/cliphf

PHP Cli Formatting library.

  • Thursday, December 8, 2016
  • by hvolschenk
  • Repository
  • 1 Watchers
  • 0 Stars
  • 35 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

CliPh-F

Very simple PHP CLI formatter., (*1)

Installation

Cliphf can either be cloned from the repository on Github or it can be installed via composer. The preferred way is through composer as you will then be able to receive updates easily., (*2)

Composer

$ php composer.phar require hvolschenk/cliphf

Git

$ git clone https://github.com/righteous-trespasser/cliphf.git

Usage

Output

You can format output for the command line with the Output::format static method. It takes in only one argument and that is the string to be formatted. You can specify formats in an HTML-like syntax as in the following example:, (*3)

use Hvolschenk\Cliphf;

Output::format('{italic}Checking config{/italic}...');
if ($something === true) {
  Output::format('{bold}{green}Done.{/green}{/bold}')
}

Input

Capuring input is just as simple. You can specify normal text inputs and password inputs through CliPh-F with formatted labels:, (*4)

$name = Input::text('Please enter your name: ');
$password = Input::password('Secret password: ');

Input text can also be formatted and uses the output class to format text:, (*5)

use Hvolschenk\Cliphf;

$name = Input::text('{bold}{underline}Dangerous input:{/underline}{/bold}');

Rules

There are 10 style rules for text and 8 colors built-in. The rules are:, (*6)

  • blink
    • Creates blinking text
  • bold
    • Highlights the text by using a bold font
  • dim
    • Dims the text by making the color darker
  • hide
    • Creates hidden text (Same color as background, un-highlight-able)
  • invert
    • Inverts the backgroud and foreground colors
  • italic
    • Emphasises text by making it italic
  • strikethrough
    • Draws a line through the text
  • underline
    • Draws attention to the text by underlining it
  • remove
    • removes all formatting
  • break
    • Adds a linebreak

The 8 colors are:, (*7)

  • black
  • blue
  • cyan
  • green
  • magenta
  • red
  • white
  • yellow

The Versions

08/12 2016

dev-master

9999999-dev https://github.com/hvolschenk/cliphf

PHP Cli Formatting library.

  Sources   Download

MIT

The Requires

 

php cli formatter formatting

06/12 2016

v3.0.1

3.0.1.0 https://github.com/hvolschenk/cliphf

PHP Cli Formatting library.

  Sources   Download

MIT

The Requires

 

php cli formatter formatting

17/11 2016

v3.0.0

3.0.0.0 https://github.com/hvolschenk/cliphf

PHP Cli Formatting library.

  Sources   Download

MIT

The Requires

 

php cli formatter formatting

16/11 2016

v2.0.1

2.0.1.0 https://github.com/righteous-trespasser/CliPhF

PHP Cli Formatting library.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

php cli formatter formatting

16/11 2016

v2.0.0

2.0.0.0 https://github.com/righteous-trespasser/CliPhF

PHP Cli Formatting library.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

php cli formatter formatting

16/11 2016

v1.0.1

1.0.1.0 https://github.com/righteous-trespasser/CliPhF

PHP Cli Formatting library.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

php cli formatter formatting

16/11 2016

v1.0.0

1.0.0.0 https://github.com/righteous-trespasser/CliPhF

PHP Cli Formatting library.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

php cli formatter formatting