MilesChou / pherm

Small utility for interacting with with the terminal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pherm - the terminal utility written by PHP

tests Coverage Status Codacy Badge License

This repo is fork from php-school/terminal

Small utility to help provide a simple, consist API for terminal interaction.

See examples to know how to use.

Usage

Hello world example:

$container = new Container();
$container->instance(Input::class, new InputStream());
$container->instance(Output::class, new OutputStream());

$terminal = (new Terminal($container))
    ->enableInstantOutput()
    ->bootstrap();

$terminal->clear();

$str = 'Hello world!';

$terminal->cursor()->center(-(mb_strlen($str) / 2))->write($str);

$terminal->cursor()->bottom();

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Small utility for interacting with with the terminal

License:MIT License


Languages

Language:PHP 99.5%Language:Makefile 0.5%