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 1mo ago

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 54% 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

3869d 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.0k30.5M332](/packages/matthiasmullie-minify)[hyn/multi-tenant

Run multiple websites using the same laravel installation while keeping tenant specific data separated for fully independant multi-domain setups.

2.6k1.1M9](/packages/hyn-multi-tenant)[tenancy/tenancy

Creating multi tenant saas from your Laravel app with ease

1.3k43.6k](/packages/tenancy-tenancy)[natxet/cssmin

Minifying CSS

827.3M98](/packages/natxet-cssmin)[stolz/assets

An ultra-simple-to-use assets management library

296519.2k8](/packages/stolz-assets)[mrclay/jsmin-php

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

5312.9M27](/packages/mrclay-jsmin-php)

PHPackages © 2026

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