sunhao fe08a6fbcc 初始 | 5 gadi atpakaļ | |
---|---|---|
.. | ||
examples | 5 gadi atpakaļ | |
src | 5 gadi atpakaļ | |
tests | 5 gadi atpakaļ | |
.gitignore | 5 gadi atpakaļ | |
.travis.yml | 5 gadi atpakaļ | |
LICENSE | 5 gadi atpakaļ | |
README.md | 5 gadi atpakaļ | |
build.xml | 5 gadi atpakaļ | |
composer.json | 5 gadi atpakaļ | |
phpunit.xml | 5 gadi atpakaļ |
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);