PHPackages                             makesites/uglifyjs-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. makesites/uglifyjs-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

makesites/uglifyjs-php
======================

Using UglifyJS as a service for JavaScript minification in PHP

0.5.0(10y ago)171048MITJavaScriptPHP &gt;=5.3.0

Since Oct 5Pushed 9y ago3 watchersCompare

[ Source](https://github.com/makesites/uglifyjs-php)[ Packagist](https://packagist.org/packages/makesites/uglifyjs-php)[ Docs](http://makesites.org)[ RSS](/packages/makesites-uglifyjs-php/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

UglifyJS.php
============

[](#uglifyjsphp)

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](https://github.com/marijnh/UglifyJS-service)

Usage
-----

[](#usage)

```
$compiler = new UglifyJS();

$compiler->add("js/my-app.js")
		->add("js/popup.js")
		->cacheDir("/tmp/js-cache/")
		->write();
```

API
---

[](#api)

These are the main methods to execute:

### cacheDir( $path )

[](#cachedir-path-)

Setting the temp dir for the cached files.

### compiler( $url )

[](#compiler-url-)

Setting the compiler location as a full url (including port) . Defaults to `http://marijnhaverbeke.nl:80/uglifyjs`

### add( $script )

[](#add-script-)

Add a script in the queue to be compressed.

### write( $output );

[](#write-output-)

Parsing queue and compressing files. Optionally outputting the result if `$output=true` (default: false)

Credits
-------

[](#credits)

Created by Makis Tracend ( [@tracend](http://github.com/tracend) )

Distributed through [Makesites.org](http://makesites.org/)

### Trivia

[](#trivia)

- Originally created to be part of [KISSCMS](https://github.com/makesites/kisscms/issues/99)
- Based on [PHP Closure](http://code.google.com/p/php-closure/) by Daniel Pupius

### License

[](#license)

Released under the [Apache License v2.0](http://makesites.org/licenses/APACHE-2.0)

###  Health Score

28

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3820d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c0f542cfdd54b4832ddb9ff4ff4cacb096fe627cc75ffcc417d58d9680931457?d=identicon)[makesites](/maintainers/makesites)

---

Top Contributors

[![tracend](https://avatars.githubusercontent.com/u/542296?v=4)](https://github.com/tracend "tracend (17 commits)")[![bronzehedwick](https://avatars.githubusercontent.com/u/637174?v=4)](https://github.com/bronzehedwick "bronzehedwick (1 commits)")[![webysther](https://avatars.githubusercontent.com/u/750007?v=4)](https://github.com/webysther "webysther (1 commits)")

---

Tags

minifysaasuglifyjs

### Embed Badge

![Health badge](/badges/makesites-uglifyjs-php/health.svg)

```
[![Health](https://phpackages.com/badges/makesites-uglifyjs-php/health.svg)](https://phpackages.com/packages/makesites-uglifyjs-php)
```

###  Alternatives

[matthiasmullie/minify

CSS &amp; JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.

2.0k29.7M277](/packages/matthiasmullie-minify)[tenancy/tenancy

Creating multi tenant saas from your Laravel app with ease

1.3k42.4k](/packages/tenancy-tenancy)[natxet/cssmin

Minifying CSS

917.3M91](/packages/natxet-cssmin)[mrclay/jsmin-php

Provides a modified port of Douglas Crockford's jsmin.c, which removes unnecessary whitespace from JavaScript files.

5312.5M24](/packages/mrclay-jsmin-php)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k3.8k1](/packages/vinkius-labs-laravel-page-speed)[tholu/php-packer

A PHP version of Packer, JavaScript obfuscation library originally created by Dean Edwards

139435.0k5](/packages/tholu-php-packer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
