decodelabs/enlighten 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

decodelabs/enlighten

Composer 安装命令:

composer require decodelabs/enlighten

包简介

PHP source highlighter

README 文档

README

PHP from Packagist Latest Version Total Downloads GitHub Workflow Status PHPStan License

PHP source highlighter

Enlighten provides exhaustive and accurate PHP source highlighting for use in debugging systems.

Installation

This package requires PHP 8.4 or higher.

Install via Composer:

composer require decodelabs/enlighten

Usage

Enlighten uses the PHP tokenizer extension which requires the full source from file (including <?php open tag).

It is effectively a more thorough version of highlight_string and highlight_file - grammar is properly wrapped and name entities are parsed according to their surrounding tokens to work out what type they are (function name, class name, etc, etc).

Enlighten also offers the ability to extract certain portions of the code and focus on a specific line. Line numbers are included in the output HTML to aid in readability.

use DecodeLabs\Enlighten\Highlighter;

$highlighter = new Highlighter();
echo $highlighter->highlight($phpSourceCode); // Highlight source code in memory
echo $highlighter->highlightFile($phpFile, 15, 35, 20); // Highlight specific lines (15 to 35) in file (focus on 20)

echo $highlighter->extract($phpSourceCode, 20); // Extract code around specific line
echo $highlighter->extractFromFile($phpFile, 20); // Extract code around specific line

Licensing

Enlighten is licensed under the MIT License. See LICENSE for the full license text.

统计信息

  • 总下载量: 22.59k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 9
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-09-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固