makesites / uglifyjs-php
Using UglifyJS as a service for JavaScript minification in PHP
Installs: 103
Dependents: 0
Suggesters: 0
Security: 0
Stars: 17
Watchers: 4
Forks: 8
Open Issues: 0
Language:JavaScript
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-12-25 12:10:53 UTC
README
Using UglifyJS as a service for JavaScript minification in PHP
Note that this class is abstructing the requests to a remote service run by an UglifyJS-service
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:
cacheDir( $path )
Setting the temp dir for the cached files.
compiler( $url )
Setting the compiler location as a full url (including port) . Defaults to http://marijnhaverbeke.nl:80/uglifyjs
add( $script )
Add a script in the queue to be compressed.
write( $output );
Parsing queue and compressing files. Optionally outputting the result if $output=true
(default: false)
Credits
Created by Makis Tracend ( @tracend )
Distributed through Makesites.org
Trivia
- Originally created to be part of KISSCMS
- Based on PHP Closure by Daniel Pupius
License
Released under the Apache License v2.0