PHPackages                             kkamkou/tp-minify - 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. kkamkou/tp-minify

AbandonedArchivedLibrary

kkamkou/tp-minify
=================

Zend Framework 2 module which uses the Steve (mrclay) Clay's Minify library for styles and scripts obfuscation

1.2(12y ago)518.9k↓69.4%4BSD-2-ClausePHPPHP &gt;=5.3.3

Since Jun 1Pushed 11y ago1 watchersCompare

[ Source](https://github.com/kkamkou/tp-minify)[ Packagist](https://packagist.org/packages/kkamkou/tp-minify)[ Docs](http://github.com/kkamkou/tp-minify)[ RSS](/packages/kkamkou-tp-minify/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

TpMinify - third-party module for the Zend Framework 2
------------------------------------------------------

[](#tpminify---third-party-module-for-the-zend-framework-2)

This module uses the [Steve (mrclay) Clay's Minify](http://github.com/mrclay/minify) library for styles and scripts obfuscation.

Installation
------------

[](#installation)

### Composer

[](#composer)

- Install the [Composer](http://getcomposer.org/doc/00-intro.md)
- Add `"kkamkou/tp-minify": "dev-master"` to a `composer.json` file, to the `require` section
- Execute `composer update`
- Add `'modules' => array('TpMinify', ...)` to the `application.config.php` file of your project. *Important thing is to place the "TpMinify" before any other modules.*
- Open (just an example) the `Frontend/config/module.config.php` and add this config stub:

```
'TpMinify' => array(
    'serveOptions' => array(
        'minApp' => array(
            'groups' => array(
                'css' => array(
                    '//../module/Frontend/public/css/buttons.css',
                    '//../module/Frontend/public/css/forms.css'
                ),
                'js' => array(
                    '//js/common.js'
                )
            )
        )
    )
)
```

- Put styles into the Head section:

```
$this->headLink()->prependStylesheet($this->basePath('/min?g=css'))
$this->headScript()->prependFile($this->basePath('/min?g=js'))
// or
$this->headLink()->prependStylesheet($this->basePath('/min?f=example.css'))
```

Options
-------

[](#options)

[Source code with the description of variables](https://code.google.com/p/minify/source/browse/min/config.php). For example:

```
// $min_cacheFileLocking
'TpMinify' => array('cacheFileLocking' => ...);
// $min_serveOptions['bubbleCssImports']
'TpMinify' => array('serveOptions' => array('bubbleCssImports' => ...));
// etc.
```

### How-To

[](#how-to)

###### What to do with the `/module/YourModule/public/images/` folder?

[](#what-to-do-with-the-moduleyourmodulepublicimages-folder)

a. Create a symlink to this module (`/public/images/modules/YourModule`) and enable the [Manual Rewriting](http://code.google.com/p/minify/wiki/UriRewriting).

```
'TpMinify' => array(
    'serveOptions' => array(
        'rewriteCssUris' => false,
        'minifierOptions' => array(
            'text/css' => array('prependRelativePath' => '/images/modules/YourModule/')
        )
    )
)
```

b. Add the `symlinks` option if needed, which is described in the [configuration file](https://code.google.com/p/minify/source/browse/min/config.php) and [here](https://code.google.com/p/minify/wiki/AlternateFileLayouts).

```
'minifierOptions' => array(
    'text/css' => array(
        'symlinks' => array(
            '//fonts' => Module::DIR . '/public/fonts'
        )
    )
)
```

###### Is it possible to minify inline scripts?

[](#is-it-possible-to-minify-inline-scripts)

Enable the HeadScript view helper:

```
'TpMinify' => array(
    'helpers' => array(
        'headScript' => array(
            'enabled' => true,
            'options' => array() // serveOptions here if needed
        )
    )
)
// and use it in your templates

$(function() {
    console.log('hello');
});

```

###### I have two or more modules, how to deal with that?

[](#i-have-two-or-more-modules-how-to-deal-with-that)

1. Put a common stuff into the `global.php`
2. And put a module-dependent stuff into the `module.config.php` of each module
3. Use prefixes for groups: `backend-css` and `frontend-css` etc.

License
-------

[](#license)

The MIT License (MIT)

Copyright (c) 2013-2014 Kanstantsin Kamkou

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~24 days

Total

3

Last Release

4676d ago

### Community

Maintainers

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

---

Top Contributors

[![kkamkou](https://avatars.githubusercontent.com/u/305739?v=4)](https://github.com/kkamkou "kkamkou (50 commits)")

---

Tags

minifyzf2assetobfuscation

### Embed Badge

![Health badge](/badges/kkamkou-tp-minify/health.svg)

```
[![Health](https://phpackages.com/badges/kkamkou-tp-minify/health.svg)](https://phpackages.com/packages/kkamkou-tp-minify)
```

###  Alternatives

[stolz/assets

An ultra-simple-to-use assets management library

296519.2k8](/packages/stolz-assets)[fisharebest/laravel-assets

Asset management for Laravel

208.1k](/packages/fisharebest-laravel-assets)

PHPackages © 2026

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