secomapp/uglifyjs-php

Using UglifyJS as a service for JavaScript minification in PHP

Installs: 21

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 8

Language:JavaScript

dev-master 2015-07-16 10:47 UTC

This package is auto-updated.

Last update: 2024-12-15 19:55:58 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

License

Released under the Apache License v2.0