PHPackages                             themallen/mender - 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. themallen/mender

ActiveLibrary

themallen/mender
================

Mender is a css/js minifier and combiner.

013PHP

Since Jul 28Pushed 11y agoCompare

[ Source](https://github.com/TheMallen/mender)[ Packagist](https://packagist.org/packages/themallen/mender)[ RSS](/packages/themallen-mender/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

\###Mender

Mender is a class that does a simple but very useful thing: it combines your CSS / Javascripts into one file (one for CSS and one for Javascript), then minimizes these files on the fly. It makes your site load faster due to reduced number of HTTP requests. It also reduces server load and traffic. Mender is written in pure PHP and can be used even on very restricted shared hostings. It does not require any other technology, such as Java or Python.

I forked Bender to make it compatible with Composer, as well as make general improvements to the idea.

Original Project description, instructions and updates:

*Mender requires php 5.3 for namespaces and other goodness. If you a version working for older versions, check out the original Bender.*

### Changelog

[](#changelog)

Monday July 28th, 2014

- Refactored code to make use of a `fileClient`, including a basic one which wraps the global functions.
    - This allows you to make use of [Mile](https://github.com/TheMallen/Mile) or any other library you want, as long as an interface with `put()` and `get()` methods is presented.
- If you are using the basic fileclient you will need to have files ready for the compiled js and css to be written to.

Friday, July 25th, 2014

- Pretty big refactor to make it a proper composer package.
- Removed ugly code in some spots.
- Restructured dependencies.
- Added support for passing a config array to the constructor.

Friday, November 1, 2013

- Changed a way to check if recombination / minification is required. Now it recombines / minimizes css and javascript files only if one of original files were changes, instead of forced compilation of all scripts based on time-to-live

### Usage

[](#usage)

```
require_once "../vendor/autoload.php";
$mender = new Mender(array(
        'path' => '',
    ));
$mender->enqueue( "assets/css/bootstrap.css" );
$mender->enqueue( "assets/css/bootstrap-theme.css" );
$mender->enqueue( "assets/js/jquery-1.10.2.js" );
$mender->enqueue( "assets/js/bootstrap.js" );
echo $mender->output( "cache/stylesheet.css" );

```

To take a look at a working example, just navigate to the test folder and run `php -S localhost:8000`, open a web browser, and navigate to `localhost:8000`. You should be able to view the compressed source and whatnot in your browser debug tools.

#### Configuration

[](#configuration)

When instantiating a Mender instance, one passes a configuration array. this array can contain the following keys:

- ttl : time to live for compiled css/js in seconds. -1 is never recompile, 0 is always recompile.
- jsmin : the name of the module to use for minimizing js.
- cssmin : the name of the module to use for minimizing css.
- path : the path to your app from the server root.
- fileClient : an instance of an object which complies with the fileClient interface.

It's possible that future versions will change this configuration array significantly! For example I am currently considering replacing jsmin and cssmin with instances of an interface similar to fileClient. Alternatively I might move into a more functional style and have cssmin, jsmin, and fileClient all replaced with function arguments.

### Contributing

[](#contributing)

If you have cool ideas or just want to give some input, open an issue! I'm quite friendly.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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://avatars.githubusercontent.com/u/107556?v=4)[Mark Allen](/maintainers/Mallen)[@mallen](https://github.com/mallen)

---

Top Contributors

[![esiteq](https://avatars.githubusercontent.com/u/3126936?v=4)](https://github.com/esiteq "esiteq (10 commits)")

### Embed Badge

![Health badge](/badges/themallen-mender/health.svg)

```
[![Health](https://phpackages.com/badges/themallen-mender/health.svg)](https://phpackages.com/packages/themallen-mender)
```

PHPackages © 2026

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