Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lablnet/php-minify

Minify your code commpress the size, increased speed
https://github.com/lablnet/php-minify

classes compresed free html master minify oop php reduce

Last synced: 2 months ago
JSON representation

Minify your code commpress the size, increased speed

Awesome Lists containing this project

README

        

# PHP Minify
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
htmlMinify('test.html');
$file = $minify->cssMinify("test.html");
$file = $minify->javascriptMinify("test.html");

var_dump($file);
```
```test.html```
```html

Im not mainfied

/*im comments in css block */
body {
background-color: black;
color: white;
/*display: inline-flex;*/
}

Im heading


Im paragraph



/* im script */
document.getElementById('demo').innerHTML = 'Hello JavaScript';

```

## 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](https://img.balancebadge.io/btc/37x6PA4qtPu2fQnYdW5U7jztYhbchASpBV.svg)](https://img.balancebadge.io/btc/37x6PA4qtPu2fQnYdW5U7jztYhbchASpBV.svg)

```37x6PA4qtPu2fQnYdW5U7jztYhbchASpBV```

Thanks you so much.

## Disclaimer
**I don't Accept any responsibility for any illegal usage**