2017 © Pedro Peláez
 

library terminal

PHP CLI/Terminal for color, blink and format output messages

image

srknzcn/terminal

PHP CLI/Terminal for color, blink and format output messages

  • Friday, July 28, 2017
  • by SRKNZCN
  • Repository
  • 1 Watchers
  • 0 Stars
  • 24 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

PHP CLI/Terminal library

Installation and Usage

require srknzcn/terminal package as dev-master in your composer.json file

Usage:

<?php

include "./vendor/autoload.php";

use CLI\Terminal;

// simple output
Terminal::writeln("Hello World");

// colorize the output
Terminal::writeln("Hello World", "red");

// blink parameter flashes the output
Terminal::writeln("Hello World", "yellow", "blink");

// bold, underline and color 
Terminal::writeln("Hello World", "cyan", "bold", "underline");

// changing of parameeters order does't matter
Terminal::writeln("Hello World", "bold", "blink", "cyan", "underline");

// red on yellow background
Terminal::writeln("Hello World", "onyellow", "red");

// only print message to output. don't add new line
Terminal::write("Hello World");

// kills the script and prints message to output
Terminal::dieln("I'm died :(", "yellow", "underline);

Formatter attributes:

  • bold
  • dark
  • faint
  • underline
  • underscore
  • blink
  • reverse

Color attributes:

  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white
  • brightblack
  • brightred
  • brightgreen
  • brightyellow
  • brightblue
  • brightmagenta
  • brightcyan
  • brightwhite

Background color attributes:

  • onblack
  • onred
  • ongreen
  • onyellow
  • onblue
  • onmagenta
  • oncyan
  • onwhite
  • onbrightblack
  • onbrightred
  • onbrightgreen
  • onbrightyellow
  • onbrightblue
  • onbrightmagenta
  • onbrightcyan
  • onbrightwhite

The Versions

28/07 2017

dev-master

9999999-dev

PHP CLI/Terminal for color, blink and format output messages

  Sources   Download

by Avatar SRKNZCN