sunhao fe08a6fbcc 初始 | 5 years ago | |
---|---|---|
.. | ||
examples | 5 years ago | |
src | 5 years ago | |
tests | 5 years ago | |
.gitignore | 5 years ago | |
.travis.yml | 5 years ago | |
LICENSE | 5 years ago | |
README.md | 5 years ago | |
build.xml | 5 years ago | |
composer.json | 5 years ago | |
phpunit.xml | 5 years ago |
Highlight PHP code in console (terminal).
Just create a composer.json
file and run the php composer.phar install
command to install it:
{
"require-dev": {
"jakub-onderka/php-console-highlighter": "0.*"
}
}
<?php
use JakubOnderka\PhpConsoleColor\ConsoleColor;
use JakubOnderka\PhpConsoleHighlighter\Highlighter;
require __DIR__ . '/vendor/autoload.php';
$highlighter = new Highlighter(new ConsoleColor());
$fileContent = file_get_contents(__FILE__);
echo $highlighter->getWholeFile($fileContent);