lablnet/minify 问题修复 & 功能扩展

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

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

lablnet/minify

最新稳定版本:1.0

Composer 安装命令:

composer require lablnet/minify

包简介

PHP Minify package.

README 文档

README

Minify your code with php

Requirement

  1. PHP 7 (7.3 Recommanded).
  2. Composer.

Insallation

Installing this package is very simple, first ensure you have the right PHP version and composer installed then in your terminal/(command prompt) run: composer require lablnet/minify

Feature

  • Minify HTML
  • Minify CSS
  • Minify JavaScript

Example

<?php
# index.php

require_once '../vendor/autoload.php';

$minify = new Minify();
$file = $minify->htmlMinify('test.html');
$file = $minify->cssMinify("test.html");
$file = $minify->javascriptMinify("test.html");

var_dump($file);

test.html

<!DOCTYPE html>
<html>
<head>
	<title>Im not mainfied</title>
	<style type="text/css">
	/*im comments in css block */
		body {
			background-color: black;
			color: white;
			/*display: inline-flex;*/
		}
	</style>
</head>
<body>
	<h1>Im heading</h1>
	<p>Im paragraph</p>
	<p id='demo'></p>
	<!-- Im html comments  -->
</body>
<script type="text/javascript">
	/* im script */
	document.getElementById('demo').innerHTML = 'Hello JavaScript';
</script>
</html>

Methods

  • htmlMinify($file, $type) Minify HTML code, $file file path or code, $type supported, file, code.
  • cssMinify($file, $type) Minify CSS code, $file file path or code, $type supported, file, code.
  • javascriptMinify($file, $type) Minify JS code, $file file path or code, $type supported, file, code.

Contributions

There is still a lot of work to do, so feel free to contribute to open PR

License

MIT

Support

Donate coffee?
here is the bitcoin address
Balance

37x6PA4qtPu2fQnYdW5U7jztYhbchASpBV

Thanks you so much.

Disclaimer

I don't Accept any responsibility for any illegal usage

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固