Code is need some optimisations, but I needed to do it fast
Well ok, instruction:
1. Download minify from http://code.google.com/p/minify/
2. Unpack Compressor.php from /min/lib/Minify/CSS/ to sapphire/thirdparty/minify
3. Open sapphire/core/Requirements.php
4. Find and replace foreach on 1000th line with that =))
foreach(array_diff($fileList, $this->blocked) as $file) {
$fileContent = file_get_contents($base . $file);
// if we have a javascript file and jsmin is enabled, minify the content
$isJS = stripos($file, '.js');
if($isJS && $this->combine_js_with_jsmin) {
require_once('thirdparty/jsmin/jsmin.php');
increase_time_limit_to();
$fileContent = JSMin::minify($fileContent);
} else {
$isCSS = stripos($file, '.css');
if($isCSS) {
require_once('thirdparty/minify/Compressor.php');
increase_time_limit_to();
$fileContent = Minify_CSS_Compressor::process($fileContent);
}
}
// write a header comment for each file for easier identification and debugging
// also the semicolon between each file is required for jQuery to be combinable properly
$combinedData .= "/****** FILE: $file *****/\n" . $fileContent . "\n".($isJS ? ';' : '')."\n";
}
To-do:
1. replace $isCSS && $isJS with one property
2. add $this->combine_css_with_minify property
3. add minify option for all required css's (not only combined)
4. like 3rd, but for JS and JSmin