Download the PHP package robinthehood/terminal without Composer
On this page you can find all versions of the php package robinthehood/terminal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download robinthehood/terminal
More information about robinthehood/terminal
Files in robinthehood/terminal
Package terminal
Short Description With Terminal you can easily output colored text on the console with php.
License MIT
Informations about the package terminal
Terminal - Ouput Color with PHP
About
With Terminal you can easily output colored text on the console with php. Terminal uses the 'terminal escape sequences' to display colored text. If you wish more features feel free to contribute.
Installation
If Composer is installed globally, run
How to use
Code
Result on the console
Displays the string on the console in red:
Colors
Terminal::BLACK
Terminal::RED
Terminal::GREEN
Terminal::YELLOW
Terminal::BLUE
Terminal::MAGENTA
Terminal::CYAN
Terminal::ORANGE
Terminal::LIGHT_GRAY
Terminal::DARK_GRAY
Terminal::LIGHT_RED
Terminal::LIGHT_GREEN
Terminal::LIGHT_YELLOW
Terminal::LIGHT_BLUE
Terminal::LIGHT_MAGENTA
Terminal::LIGHT_CYAN
More examples
Example 1
Example 2
Terminal can also display line numbers:
License
Copyright (c) 2017 Robin Wieschendorf
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.