I've attached a patch that allows this module to use the JSMIN tool JSMIN-PHP library, which provides for greater compression of the javascript files. The module degrades gracefully, reverting to the old behavior (native comment stripping) if the JSMIN module is not found.
To use this patch (and the new feature) you need to download JSMIN-PHP into the javascript_aggregator module directory, and rename the JSMIN-PHP file to jsmin.php, then ensure that the aggregator is configured to compress the js files. Flushing the aggregator cache is also a good idea.
JSMIN-PHP Requries PHP 5. This should not create problems for PHP 4 users, since you don't get the JSMIN functionality if the jsmin.php file is not located in this module's directory.
The README.txt file probably needs to be updated to reflect the new requirements and installation procedure as well.
| Comment | File | Size | Author |
|---|---|---|---|
| javascript_aggregator-jsmin-php-support.patch | 4.04 KB | mcurry |
Comments
Comment #1
chirale commentedWhat's the difference from #251140: Optimization? I've tried that "package" successfully and I'm interested in this patch. To include JSMin library this license issue must be solved: since MIT license and GPL are compatible, I think JSMin can be included in the patched version of Javascript aggregator.
Comment #2
chirale commentedSome other issues:
1) What if a yet minified file is minified one more time?
2) Should a control on source files be implemented? Douglas Crockford suggests to check and clean the code before minification, to avoid data loss.
Comment #3
robloachGreat work! Committed.... http://drupal.org/cvs?commit=150082
I changed it a bit to accept the path to jsmin.php so that you can have the library somewhere other then the module's directory.
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.