dev-master
9999999-devlibrary for console applications with input and output handling
MIT
The Requires
- php ^7.1
- ext-mbstring *
- psr/log ^1.0
The Development Requires
Wallogit.com
2017 © Pedro Peláez
library for console applications with input and output handling
PHP library for console applications. It supports formatting of messages and tables as well input handling with choices., (*2)
Like all my libraries: only with composer, (*3)
$ composer require tflori/hugga
<?php
$console = new Hugga\Console;
$name = $console->ask('What is your name?');
$console->line('${fg:white;bg:white;bold}Nice to meet you ' . $name . '!');
$console->line('You will see this', Hugga\Console::WEIGHT_NORMAL);
$console->line('You will not see this', Hugga\Console::WEIGHT_LOWER);
$console->increaseVerbosity();
$console->line('No you can see this', Hugga\Console::WEIGHT_LOWER);
$console->line('But this is just a debug message', Hugga\Console::WEIGHT_DEBUG);
//$console->setVerbosity(Hugga\Console::WEIGHT_DEBUG);
//$console->debug(
// ['key' => 'value', 'recursive' => ['string', 42, null, true]],
// Hugga\Console::DEBUG_PRETTY ^ Hugga\Console::DEBUG_COLOR
// );
There is no documentation yet except this api reference. For some examples also have a look at
examples/test.php and try them yourself with php vendor/tflori/hugga/examples/test.php., (*4)
Also, there is an example how to create a paginated table with existing features in examples/paginated-table.php'., (*5)
Some features are still planned but a lot of features are available and they are enough for start and replacing symfony/console., (*6)
${red;bold}text${r})\n.\n)library for console applications with input and output handling
MIT