PHPackages                             bvanhoekelen/php-compressor - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. bvanhoekelen/php-compressor

ActiveLibrary[File &amp; Storage](/categories/file-storage)

bvanhoekelen/php-compressor
===========================

PHP compressor merge multiple css and js files into one file

1.2.0(7y ago)61621Apache-2.0PHPPHP &gt;=5.4.0

Since Sep 25Pushed 7y ago2 watchersCompare

[ Source](https://github.com/bvanhoekelen/php-compressor)[ Packagist](https://packagist.org/packages/bvanhoekelen/php-compressor)[ RSS](/packages/bvanhoekelen-php-compressor/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (1)Versions (5)Used By (0)

PHP compressor
==============

[](#php-compressor)

[![Hex.pm](https://camo.githubusercontent.com/deba58212918eeb974a7659ab52917cf517a949f1bb99bce9bed6c74a02adb6f/68747470733a2f2f696d672e736869656c64732e696f2f686578706d2f6c2f706c75672e7376673f6d61784167653d32353932303030267374796c653d666c61742d737175617265)](https://github.com/bvanhoekelen/php-compressor/blob/master/LICENSE)[![Packagist Prerelease](https://camo.githubusercontent.com/bd52324dd598cb1942c7743a0fbff9fd181e23598323ae07bc20d5e912218fe7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f6276616e686f656b656c656e2f7068702d636f6d70726573736f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bvanhoekelen/php-compressor)[![Packagist](https://camo.githubusercontent.com/87f74bafb4063979a1fda51b24320345c5592f50de0a129562e8a4b27976f18e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6276616e686f656b656c656e2f7068702d636f6d70726573736f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bvanhoekelen/php-compressor)[![Github issues](https://camo.githubusercontent.com/a2488cdf6707e980915abb97e3f600c63b52f74841b24d3b25e8bf169ba3623f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6276616e686f656b656c656e2f7068702d636f6d70726573736f722e7376673f7374796c653d666c61742d737175617265)](https://github.com/bvanhoekelen/php-compressor/issues)[![Travis branch](https://camo.githubusercontent.com/fdd95c6d5200897983876b18784cf4ff53b7ead7e426247e223ca033b19651cc/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6276616e686f656b656c656e2f7068702d636f6d70726573736f722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/bvanhoekelen/php-compressor)[![Travis branch](https://camo.githubusercontent.com/49840ce70609df11cc7a05e5c9cf00635b3a29e029a09cdb82387b6652598d42/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6276616e686f656b656c656e2f7068702d636f6d70726573736f722f646576656c6f702e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/bvanhoekelen/php-compressor) Build: Master|Develop

[![php-compressor](/assets/banner.png)](/assets/banner.png)

Highlight
---------

[](#highlight)

- Merge several files into one file
- Live compiler, fast and no additional program is needed
- Allows user to write code that can be used in other projects » [Code reuse](https://en.wikipedia.org/wiki/Code_reuse)
- The ability to set variables » [see variable in help](https://github.com/bvanhoekelen/php-compressor/wiki)
- Support .css, .fcss and .js files
- Required no changes on the live server
- Reducing server load and client load time
- Optimizing assets for a higher rank in google search results » [PageSpeed](https://developers.google.com/speed/pagespeed/)
- Easy to install » [instalation](#instalation)
- Support for Laravel framework » [Laravel](https://laravel.com)

Workflow
--------

[](#workflow)

- Input

    - Contains the building blocks
    - Folder can be placed before the public folder, no access for external users
    - For a better overview you can split easy your code in into several files
    - No `@include`, files are automatically merged
    - Ordering happened by name
- Output

    - Each extension has its own file
    - Use normal html tag `` and `` to grab it
- PHP compressor run (PhpCompressor::run())

    - &lt;loccation&gt; (INPUT) directory where the .CSS, .FCSS and .JS files are
    - &lt;destination&gt; (OUTPUT) directory that contains the `compressor/` folder. *Note. de destination *path* is without the `compressor/`. This wil set in automatic*
    - The output of PHP compressor wil set in the `compressor/` folder as `take.*`
    - Run PHP compressor only in the developor environment, not in production!

```
    (Input)                                                           (Output)

Root/                                           .               Root/
└── Resources/             .. ..................;;.             └── Public/ (!)
    └── css/ (!)              .. PHP compresspr ;;;;.               └── compressor/ (static)
    │   ├── table.css    . . .::::::::::::::::::;;:'                   ├── take.css
    │   ├── alert.css                           :'                     └── take.js
    │   ├── button.css
    │   ...
    └── js/  (!)
    │   ├── table.js
    │   ├── alert.js
    │   ├── button.js
    │   ...
    ..

                             (PHP compressor)

 PhpCompressor::run(['resources/assets/css/', 'resources/assets/js/'], 'public/');
 PhpCompressor::run( [  , , ... ],  ); // explanation!

```

Help, docs and links
====================

[](#help-docs-and-links)

- [Help](https://github.com/bvanhoekelen/php-compressor/wiki)
- [Packagist](https://packagist.org/packages/bvanhoekelen/php-compressor)

Instalation
===========

[](#instalation)

Install with Laravel
--------------------

[](#install-with-laravel)

Get PHP compressor by running the composer command in the command line.

```
 $ composer require bvanhoekelen/php-compressor

```

Open the `AppServiceProvider.php` located in `App\Providers\`.

```
// Add namespace at the top
use PhpCompressor\PhpCompressor;

// Place the code in the `public function boot()`.
if(config('app.debug')) // DON'T USE ON PRODUCTION !!
    PhpCompressor::run(['resources/assets/css/', 'resources/assets/js/'], 'public/');
```

Place the code in `` from the html file.

```

```

Install with composer
---------------------

[](#install-with-composer)

Get PHP compressor by running the composer command in the command line.

```
 $ composer require bvanhoekelen/php-compressor

```

Run PHP compressor by place code before the view is draw.

```
// Require vender autoload
require_once('../vendor/autoload.php');

// Use namespace
use PhpCompressor\PhpCompressor;

// Switch which determines if environment is production
$production = false;

// Run php conpressor
if( ! $production ) // DON'T USE ON PRODUCTION !!
    PhpCompressor::run(['resources/css/', 'resources/js/'], 'public/');
```

Place the code in `` from the html file.

```

```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

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 ~407 days

Total

3

Last Release

2750d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ae4ee069f1a323e71f722f3f738e807b7ed7403444054bd64d01618ef1de121b?d=identicon)[Bart van Hoekelen](/maintainers/Bart%20van%20Hoekelen)

---

Top Contributors

[![bvanhoekelen](https://avatars.githubusercontent.com/u/5804062?v=4)](https://github.com/bvanhoekelen "bvanhoekelen (3 commits)")

---

Tags

phplaraveljavascriptcssJSfilecompressorphp-compressorfcssFast CSSCascading Style SheetsStyle Sheetsfast-css.com

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bvanhoekelen-php-compressor/health.svg)

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

###  Alternatives

[servocoder/richfilemanager

RichFilemanager - highly customizable open-source file manager

90963.7k2](/packages/servocoder-richfilemanager)[soarecostin/file-vault

191196.2k](/packages/soarecostin-file-vault)[andrewelkins/cabinet

Laravel 4 file upload package.

1011.7k](/packages/andrewelkins-cabinet)[tomatophp/filament-browser

File &amp; Folders &amp; Media Browser With Code Editor

408.6k2](/packages/tomatophp-filament-browser)[brainstud/file-vault

1231.9k](/packages/brainstud-file-vault)

PHPackages © 2026

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