https://github.com/taufik-nurrohman/minify
Reduce CSS, HTML, JavaScript, JSON, PHP, and XML code size on the server side.
https://github.com/taufik-nurrohman/minify
compress css html javascript js json minify php reduce uglify xml
Last synced: 6 months ago
JSON representation
Reduce CSS, HTML, JavaScript, JSON, PHP, and XML code size on the server side.
- Host: GitHub
- URL: https://github.com/taufik-nurrohman/minify
- Owner: taufik-nurrohman
- License: mit
- Created: 2024-02-18T05:59:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-11-04T03:10:47.000Z (7 months ago)
- Last Synced: 2025-11-04T05:24:10.238Z (7 months ago)
- Topics: compress, css, html, javascript, js, json, minify, php, reduce, uglify, xml
- Language: PHP
- Homepage: https://github.com/mecha-cms/x.minify
- Size: 137 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PHP Minify
==========
![c-s-s.php] ![h-t-m-l.php] ![j-s.php] ![j-s-o-n.php] ![p-h-p.php] ![x-m-l.php]
[c-s-s.php]: https://img.shields.io/github/size/taufik-nurrohman/minify/index/c-s-s.php?branch=main&color=%234f5d95&label=c-s-s.php&labelColor=%231f2328&style=flat-square
[h-t-m-l.php]: https://img.shields.io/github/size/taufik-nurrohman/minify/index/h-t-m-l.php?branch=main&color=%234f5d95&label=h-t-m-l.php&labelColor=%231f2328&style=flat-square
[j-s.php]: https://img.shields.io/github/size/taufik-nurrohman/minify/index/j-s.php?branch=main&color=%234f5d95&label=j-s.php&labelColor=%231f2328&style=flat-square
[j-s-o-n.php]: https://img.shields.io/github/size/taufik-nurrohman/minify/index/j-s-o-n.php?branch=main&color=%234f5d95&label=j-s-o-n.php&labelColor=%231f2328&style=flat-square
[p-h-p.php]: https://img.shields.io/github/size/taufik-nurrohman/minify/index/p-h-p.php?branch=main&color=%234f5d95&label=p-h-p.php&labelColor=%231f2328&style=flat-square
[x-m-l.php]: https://img.shields.io/github/size/taufik-nurrohman/minify/index/x-m-l.php?branch=main&color=%234f5d95&label=x-m-l.php&labelColor=%231f2328&style=flat-square
Motivation
----------
This project was started as a [gist][gist/minify], which now has more stars than [the copy of it][mecha-cms/x.minify],
that was actually made to abandon the gist. It was inspired by [a code snippet][ideone], that will probably get lost in
the future, so I decided to make [a copy of it][gist/ideone].
I once got an e-mail from someone who wanted to use some parts of [my extension’s code][mecha-cms/x.minify], for him to
use in a proprietary application, hoped not to be bound by [the GPL restrictions][article/gpl]. It was not possible
legally at first, due to the nature that an extension will always be a part of its core application. And its core
application, in this case, were using the GPL license from the start. And so, its extensions have to be licensed under
the GPL license too.
I then decided to completely re-write this project under the MIT license because I no longer view this implementation as
a “complex thing” that it takes a lot of effort to program it. I also want to make my implementation generally available
to a wide range of people (including those who develop proprietary applications), so it will be easier for me to get
financial support from them.
[article/gpl]: https://mecha-cms.com/article/general-public-license
[gist/ideone]: https://gist.github.com/taufik-nurrohman/db723da29e69065a1130
[gist/minify]: https://gist.github.com/taufik-nurrohman/d7b310dea3b33e4732c0/804ae266c30664e7dcdf1d7d544628f7790bdad8
[ideone]: https://ideone.com/Q5USEF
[mecha-cms/x.minify]: https://github.com/mecha-cms/x.minify
Usage
-----
This converter can be installed using [Composer](https://packagist.org/packages/taufik-nurrohman/minify), but it doesn’t
need any other dependencies and just uses Composer’s ability to automatically include files. Those of you who don’t use
Composer should be able to include the `index.php` file directly into your application without any problems.
### Using Composer
From the command line interface, navigate to your project folder then run this command:
~~~ sh
composer require taufik-nurrohman/minify
~~~
Require the generated auto-loader file in your application:
~~~ php