UglifyJS.php
Using UglifyJS as a service for JavaScript minification in PHP, (*1)
Note that this class is abstructing the requests to a remote service run by an UglifyJS-service, (*2)
Usage
$compiler = new UglifyJS();
$compiler->add("js/my-app.js")
->add("js/popup.js")
->cacheDir("/tmp/js-cache/")
->write();
API
These are the main methods to execute:, (*3)
cacheDir( $path )
Setting the temp dir for the cached files., (*4)
compiler( $url )
Setting the compiler location as a full url (including port) . Defaults to http://marijnhaverbeke.nl:80/uglifyjs, (*5)
add( $script )
Add a script in the queue to be compressed., (*6)
write( $output );
Parsing queue and compressing files. Optionally outputting the result if $output=true (default: false), (*7)
Credits
Created by Makis Tracend ( @tracend ), (*8)
Distributed through Makesites.org, (*9)
Trivia
License
Released under the Apache License v2.0, (*10)