robotdance / php-console
Utilities for console output and text animations
Requires
- php: >=5.3.2
- robotdance/php-arguments: 0.0.4
Requires (Dev)
- codeclimate/php-test-reporter: dev-master
- phpdocumentor/phpdocumentor: 2.*
- phpunit/phpunit: 4.8.24
This package is not auto-updated.
Last update: 2025-01-16 02:03:29 UTC
README
PHP-Console is an utility class for console output and text animations.
Animations (new!)
You can produce ASC Art animations using a simple sprite structure and animate them in your console output.
use robotdance/Sprite; ... $spr = new Sprite('./sprites/blinking_programmer.spr'); echo $spr->animate(); }
That will produce a programmer blinking his eyes in front of the computer:
The sprite files are easy to build. A fast hack into the example vim sprites/blinking_programmer.spr
and the sprite class vim src/Sprite.php
will show you how to make your own animations. Have fun!
Ansi color output examples
use robotdance/Console; ... echo Console::red('Bob is going home'); // red text echo Console::apply('Bob is going home', ['red', 'bold']); // red and bold text echo Console::indent('Bob is going home', 4, 2); two levels of identation }
Please take a look at the source comments and generate docs through PHPDocumentor to learn more.
Setup
PHP-Console uses Composer as dependency manager.
$ composer install
You may also generate documentation:
$ ./bin/phpdoc -d ./src/ -t ./docs/
Testing
$ ./bin/phpunit
Contribute
Fork, code your tests and modifications, write a good commit message and submit a pull request. All tests must pass and the coverage must remains at 100%.