PHPackages                             mamuz/squeezer - 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. mamuz/squeezer

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

mamuz/squeezer
==============

PHP library minifier

v0.2.1(10y ago)109682MITPHPPHP &gt;=5.4

Since Jun 29Pushed 10y ago1 watchersCompare

[ Source](https://github.com/mamuz/Squeezer)[ Packagist](https://packagist.org/packages/mamuz/squeezer)[ Docs](https://github.com/mamuz/Squeezer)[ RSS](/packages/mamuz-squeezer/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (6)Dependencies (5)Versions (7)Used By (0)

Squeezer
========

[](#squeezer)

[![Author](https://camo.githubusercontent.com/e49859db77ebe675300539af2d01c10b7568b92df2dbbd190335170cd198e5fa/687474703a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d406d616d757a5f64652d626c75652e7376673f7374796c653d666c61742d737175617265)](https://twitter.com/mamuz_de)[![Build Status](https://camo.githubusercontent.com/05f9b609ef9e654b6bd3b302e36b8008dfa294609b533f6a2e340ca5046f7bec/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d616d757a2f53717565657a65722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/mamuz/Squeezer)[![Coverage Status](https://camo.githubusercontent.com/9c464d11f6abadff264e1092e553c40bfdecd3f07eaf68e698c431f6f22dce59/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6d616d757a2f53717565657a65722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/mamuz/Squeezer/code-structure)[![Quality Score](https://camo.githubusercontent.com/703c8d96a852c2780a97c6bdd2fed8154c8b60bb5163c25ac1e60f867aac2a17/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6d616d757a2f53717565657a65722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/mamuz/Squeezer)[![Dependency Status](https://camo.githubusercontent.com/afe1b86691783b6205584d4ee930a02f0102b211e9d2128e2564eee07916ddf2/68747470733a2f2f696d672e736869656c64732e696f2f76657273696f6e6579652f642f757365722f70726f6a656374732f3535393266646166363233383339303031383030303030312e7376673f7374796c653d666c61742d737175617265)](https://www.versioneye.com/user/projects/5592fdaf6238390018000001)

[![Latest Stable Version](https://camo.githubusercontent.com/2ae245c2460d4edfe2012305e6550bd41f45b0ac8fe35ba9258656f599fc624c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d616d757a2f73717565657a65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mamuz/squeezer)[![Total Downloads](https://camo.githubusercontent.com/e98681d11f0a449cd44c726240d37f8421462ebe9a1da6bba1ec893e6f06e9e6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d616d757a2f73717565657a65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mamuz/squeezer)[![License](https://camo.githubusercontent.com/c36ea38437c02b639dbafa3b5ed1f3f16356c903ed4e8c5e2e36b5cfe1545c6f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d616d757a2f73717565657a65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mamuz/squeezer)

Squeezer is a minifier for php class files. It will parse your directories to find valid classes, interfaces and traits and squeeze them to one file. Autoloading in php is quite nice but also expensive. Sometimes too expensive for production. Using a minified file reduces the execution time of your application but increases the memory usage. Take care which directories or packages you want to squeeze. For production you should only squeeze used packages.

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

[](#installation)

The recommended way to install [`mamuz/squeezer`](https://packagist.org/packages/mamuz/squeezer) is through [composer](http://getcomposer.org/) by adding dependency to your `composer.json`:

```
{
    "require-dev": {
        "mamuz/squeezer": "0.*"
    }
}
```

Features
--------

[](#features)

- Minify classes, interfaces and traits to one compressed file.
- Validates availability of class dependencies.
- Removing comments and docblocks is optional to keep interoperability to annotation parser.
- PHP files with more than one class, interface or trait declarations will be skipped.
- PHP files with `include`, `include_once`, `require` or `require_once` statements will be skipped.
- PHP files with function calls to handle files like `fopen` or `mkdir`will be skipped.
- PHP files with a `declare` statement will be skipped.

Usage
-----

[](#usage)

Run this command line to squeeze your library without comments to `classes.min.php`:

```
./vendor/bin/squeeze classes.min.php --source="module/*/src, vendor/zendframework/*/src" --exclude="zend-loader" --nocomments
```

*For instance, we are using a typical ZendFramework Application, but you can adapt this command to each environment*

After that you can include `classes.min.php` inside your `index.php`, but before loading composer autoloader.

For instance...

```
//...
include_once 'classes.min.php';
include_once 'vendor/autoload.php'; // composer autoloader
//...
```

Use this command to get synopsis about all arguments

```
./vendor/bin/squeeze --help
```

###  Health Score

29

—

LowBetter than 58% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

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.

###  Release Activity

Cadence

Every ~44 days

Recently: every ~54 days

Total

6

Last Release

3779d ago

### Community

Maintainers

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

---

Top Contributors

[![mamuz](https://avatars.githubusercontent.com/u/4173317?v=4)](https://github.com/mamuz "mamuz (106 commits)")

---

Tags

autoloaderclassesminifyphpperformanceminifyImprovement

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mamuz-squeezer/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[phparkitect/phparkitect

Enforce architectural constraints in your PHP applications

9134.1M24](/packages/phparkitect-phparkitect)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k44](/packages/friendsoftypo3-content-blocks)[coenjacobs/mozart

Composes all dependencies as a package inside a WordPress plugin

4783.9M23](/packages/coenjacobs-mozart)[brianhenryie/strauss

Prefixes dependencies namespaces so they are unique to your plugin

187406.5k30](/packages/brianhenryie-strauss)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

54642.4k4](/packages/jolicode-castor)

PHPackages © 2026

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