abordage/html-min
最新稳定版本:0.2.2
Composer 安装命令:
composer require abordage/html-min
包简介
Very simple (and very fast) PHP package for HTML minification
README 文档
README
HtmlMin: PHP package for HTML minification
Very simple (and very fast) html compression. See benchmark and comparison
Features:
- Removing extra whitespaces
- Removing html comments
- Skip
textarea,preandscriptelements - Compresses in microseconds. See benchmark and comparison
Requirements
- PHP 7.4 - 8.2
Installation
You can install the package via composer:
composer require abordage/html-min
Quick start
<?php require __DIR__ . '/vendor/autoload.php'; $htmlMin = new Abordage\HtmlMin\HtmlMin(); $result = $htmlMin->minify("<!DOCTYPE html><html> ... </html>");
Options
$htmlMin->findDoctypeInDocument(); // default: true $htmlMin->removeWhitespaceBetweenTags(); // default: true $htmlMin->removeBlankLinesInScriptElements(); // default: false
Benchmark
See abordage/html-min-benchmark
Testing
composer test:all
or
composer test:phpunit composer test:phpstan composer test:phpcsf
or see https://github.com/abordage/html-min/actions/workflows/tests.yml
Feedback
If you have any feedback, comments or suggestions, please feel free to open an issue within this repository.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 86.75k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 3
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04
