Download the PHP package taufik-nurrohman/minify without Composer
On this page you can find all versions of the php package taufik-nurrohman/minify. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download taufik-nurrohman/minify
More information about taufik-nurrohman/minify
Files in taufik-nurrohman/minify
Package minify
Short Description Reduce CSS, HTML, JavaScript, JSON, PHP, and XML code size on the server side.
License MIT
Homepage https://github.com/taufik-nurrohman/minify
Informations about the package minify
PHP Minify
Motivation
This project was started as a gist, which now has more stars than the copy of it, that was actually made to abandon the gist. It was inspired by a code snippet, that will probably get lost in the future, so I decided to make a copy of it.
I once got an e-mail from someone who wanted to use some parts of my extension’s code, for him to use in a proprietary application, hoped not to be bound by the GPL restrictions. 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.
Usage
This converter can be installed using Composer, 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:
composer require taufik-nurrohman/minify
Require the generated auto-loader file in your application:
/* After */
@media (min-width:1280px)and(max-width:1919px){color:#f00}
The idea is that you are responsible for the code you are going to compress. If the original code works well, then it is likely that it will work well too after it has been compressed.
Options
CSS
function minify_html(...$v) {
return x\minify\h_t_m_l(...$v);
}
function minify_js(...$v) {
return x\minify\j_s(...$v);
}
function minify_json(...$v) {
return x\minify\j_s_o_n(...$v);
}
function minify_php(...$v) {
return x\minify\p_h_p(...$v);
}
function minify_xml(...$v) {
return x\minify\x_m_l(...$v);
}
License
This library is licensed under the MIT License. Please consider donating 💰 if you benefit financially from this library.