PHPackages                             secomapp/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. secomapp/uglifyjs-php

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

secomapp/uglifyjs-php
=====================

Using UglifyJS as a service for JavaScript minification in PHP

021JavaScript

Since Jul 16Pushed 10y ago2 watchersCompare

[ Source](https://github.com/secomapp/uglifyjs-php)[ Packagist](https://packagist.org/packages/secomapp/uglifyjs-php)[ RSS](/packages/secomapp-uglifyjs-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)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

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.7% 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.

### Community

Maintainers

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

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

---

Top Contributors

[![tracend](https://avatars.githubusercontent.com/u/542296?v=4)](https://github.com/tracend "tracend (11 commits)")[![cadicvnn](https://avatars.githubusercontent.com/u/225918?v=4)](https://github.com/cadicvnn "cadicvnn (5 commits)")[![webysther](https://avatars.githubusercontent.com/u/750007?v=4)](https://github.com/webysther "webysther (1 commits)")

### Embed Badge

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

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

###  Alternatives

[vincentbean/laravel-plausible

Laravel Plausible

2556.9k](/packages/vincentbean-laravel-plausible)

PHPackages © 2026

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