Reputation: 21749
I use PHP Minify and it's great. But my question, is there any PHP plugin or something, which would automatically detect javascript/css code and minify it automatically? Thank you.
Upvotes: 2
Views: 2479
Reputation: 38352
Do look at https://github.com/web-developer/Resource-Handler. This is a on the fly compressor and minifyer for your js. This requires least configuration or hassle, unlike the other one suggested .
Upvotes: 0
Reputation: 50976
Javascript minifier?
Take a look here
require_once('jsmin-1.1.1.php');
$files = glob("/path/to/js/merge/*.js");
$js = "";
foreach($files as $file) {
$js .= JSMin::minify(file_get_contents($file));
}
file_put_contents("/path/to/js/combined.js", $js);
// or to output it: echo $js;
Upvotes: 2