mileschou/pherm

A command line terminal utility in PHP

v0.6.0 2019-12-14 07:03 UTC

This package is auto-updated.

Last update: 2024-03-25 00:28:49 UTC


README

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.