承接 abordage/html-min 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

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

HtmlMin

Packagist Version GitHub Tests Status GitHub Code Style Status PHP Version Support License

Features:

  • Removing extra whitespaces
  • Removing html comments
  • Skip textarea, pre and script elements
  • 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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固