Highlight PHP code in terminal

Last update: May 18, 2022

PHP Console Highlighter

This repository is abandoned.

Suggested alternative: https://github.com/php-parallel-lint/PHP-Console-Highlighter


Highlight PHP code in console (terminal).

Example

Example

Install

Just create a composer.json file and run the php composer.phar install command to install it:

{
    "require": {
        "jakub-onderka/php-console-highlighter": "0.*"
    }
}

Usage

<?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);

Downloads this Month Build Status License

GitHub

https://github.com/JakubOnderka/PHP-Console-Highlighter
You might also like...

The SensioLabs DeprecationDetector runs a static code analysis against your project's source code to find usages of deprecated methods, classes and interfaces

SensioLabs DeprecationDetector CAUTION: This package is abandoned and will no longer receive any updates. The SensioLabs DeprecationDetector runs a st

Feb 21, 2022

Webman quickly creates a verification code tool similar to Google verification code

Webman quickly creates a verification code tool similar to Google verification code

webman-captcha-grid webman quickly creates a verification code tool similar to Google verification code webman 快速创建一个类似于 Google 点图验证码的本地验证码扩展 介绍 webma

Apr 30, 2022

Code to accompany the YouTube video "Full PHP cURL API tutorial - how to use a REST API from PHP using cURL"

PHP cURL CRUD Example Example code to accompany this YouTube video. Note that the init_curl.php file contains a placeholder for an API key. DO NOT che

Apr 1, 2022

The VarExporter component allows exporting any serializable PHP data structure to plain PHP code.

The VarExporter component allows exporting any serializable PHP data structure to plain PHP code. While doing so, it preserves all the semantics associated with the serialization mechanism of PHP (__wakeup, __sleep, Serializable).

May 23, 2022

A pure PHP implementation of the open Language Server Protocol. Provides static code analysis for PHP for any IDE.

A pure PHP implementation of the open Language Server Protocol. Provides static code analysis for PHP for any IDE.

A pure PHP implementation of the open Language Server Protocol. Provides static code analysis for PHP for any IDE.

May 15, 2022

Clean Code concepts adapted for PHP - A guide for producing readable, reusable, and refactorable PHP software

Clean Code concepts adapted for PHP - A guide for producing readable, reusable, and refactorable PHP software

Apr 6, 2022

Lock library to provide serialized execution of PHP code.

Requirements | Installation | Usage | License and authors | Donations php-lock/lock This library helps executing critical code in concurrent situation

May 13, 2022

🔨 Prefixes all PHP namespaces in a file/directory to isolate the code bundled in PHARs.

PHP-Scoper PHP-Scoper is a tool which essentially moves any body of code, including all dependencies such as vendor directories, to a new and distinct

May 11, 2022

Easily create and work with code snippets from PHP

code-snippets Easily create and work with code snippets from source code files of any type in PHP. The original code this package is based on was borr

Sep 30, 2021
Comments
  • 1. Convert to psr-4

    Directories have been simplified to just src/ and test/

    The Test bootstrap file is no longer needed, and the typo in the test filename has been fixed.

    Reviewed by avindra at 2016-01-07 03:41
  • 2. Release version 1.0.0

    What blockers are there to releasing a 1.0.0 version? It seems that this package is already used in production (albeit continuous-integration production, rather than user-facing).

    Reviewed by samwilson at 2017-09-09 11:29
  • 3. Fixed tokenization of empty string

    Fixes:

    PHPUnit 4.4.1 by Sebastian Bergmann.
    
    Configuration read from /PHP-Console-Highlighter/phpunit.xml
    
    .............E
    
    Time: 84 ms, Memory: 7.75Mb
    
    There was 1 error:
    
    1) JakubOnderka\PhpConsoleHighlighter\HighlighterTest::testBlank
    Undefined variable: newType
    
    /PHP-Console-Highlighter/src/JakubOnderka/PhpConsoleHighlighter/Highlighter.php:183
    /PHP-Console-Highlighter/src/JakubOnderka/PhpConsoleHighlighter/Highlighter.php:102
    /PHP-Console-Highlighter/src/JakubOnderka/PhpConsoleHighlighter/Highlighter.php:77
    /PHP-Console-Highlighter/tests/JakubOnderka/PhpConsoleHighligter/HigligterTest.php:33
    /PHP-Console-Highlighter/tests/JakubOnderka/PhpConsoleHighligter/HigligterTest.php:261
    
    FAILURES!
    Tests: 14, Assertions: 20, Errors: 1.
    
    Reviewed by hason at 2015-01-07 09:29
Highlight code blocks with league/commonmark and Shiki

Highlight code blocks with league/commonmark and Shiki This package contains a block renderer for league/commonmark to highlight code blocks using Shi

Mar 14, 2022
Run the following commands in your terminal to setup the project

Run the following commands in your terminal to setup the project You must have the LAMP installed on your system git clone https://github.com/Bashar-A

Nov 6, 2021
Terminal drawing with braille
Terminal drawing with braille

php-drawille Terminal drawing with braille. Requirements php-drawille requires PHP 5.4.0 or later. Installation The recommended way to install php-dra

May 3, 2022
Terminal management system.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

May 14, 2022
Terminal management system.

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

May 14, 2022
Result of our code-along meetup writing PHP 8.1 code

PHP 8.1 Demo Code This code demonstrates various PHP 8.0 and 8.1 features in a realistic, functional (but incomplete) codebase. The code is part of so

Nov 14, 2021
Dead Code Detector (DCD) for PHP code.

This project is no longer maintained and its repository is only kept for archival purposes. PHP Dead Code Detector (PHPDCD) phpdcd is a Dead Code Dete

May 11, 2022
⚗️ Adds code analysis to Laravel improving developer productivity and code quality.
⚗️ Adds code analysis to Laravel improving developer productivity and code quality.

⚗️ About Larastan Larastan was created by Can Vural and Nuno Maduro, got artwork designed by @Caneco, is maintained by Can Vural, Nuno Maduro, and Vik

May 20, 2022
Free ZIP Code API - Free Access to Worldwide Postal Code Data

About Zipcodebase - Free Zip Code API Zipcodebase is a zip code API that was founded in 2019 to solve common issues with postal code data. As we have

Nov 17, 2021
Preload your sweet sweet code to opcache with a composer command, making your code faster to run.

Composer Preload Preload your sweet sweet code to opcache with a composer command, making your code run faster. Composer Preload is a composer plugin

May 24, 2022