2017 © Pedro Peláez
 

library uglifyjs-php

Using UglifyJS as a service for JavaScript minification in PHP

image

secomapp/uglifyjs-php

Using UglifyJS as a service for JavaScript minification in PHP

  • Thursday, July 16, 2015
  • by cadicvnn
  • Repository
  • 2 Watchers
  • 0 Stars
  • 16 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 9 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

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)

The Versions

16/07 2015

dev-master

9999999-dev https://github.com/secomapp/uglifyjs-php

Using UglifyJS as a service for JavaScript minification in PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Cadic

api uglifyjs