Compify is a tool to save disk usage and bandwith in your composer vendor folder.

Maybe you haven’t noticed, but if you take a look to your vendor folder after doing a php composer.phar install there are so much useless information like tests, .travis.yml like files that you just don’t need in production.

Consider also packages installed from source (using git clone or svn checkout, not downloading a zip or methods base), they include folders like .git or .svn and, believe me, you don’t want those folders in production.

In most of the cases, you will be deploying to production and storing different versions of your application, installing dependencies directly from your servers or rsyncing from a deployer machine. So, using compify you can save bandwith or time when deploying. Fork it at Github.


Download phar distribution from github within your root folder of your application (same level as composer.phar).



php compify.phar crush --help
 crush [vendor-path]

 vendor-path  Composer vendor path (default: "./vendor")

 The crush command removes all the
 unnecessary files for each composer
 package in order to save disk usage
 and bandwidth.

How does it work

Compify goes through every local composer dependency installed in your machine and removes typical unnecessary files and folders (what we call generic rules) for that package. Also, we have identified specific rules for specific packages that will also merge with the generic rules.

    public static $rules = array(
        'generic-rules' => array(
        'packages-rules' => array(
            'twig/twig' => array(

You can contribute adding new package specific rules or any code update obsviously :) .


$ php compify.phar crush
Crushing vendors (by Carlos Buenosvinos)
Vendor size before crushing: 150M
Vendor size after crushing: 96M

More Information

For any issue use PR github system, for other info, send me an email to


Compify is licensed under the MIT license.


1 Comment


  1. Pingback : Emagister Engineering » Tecnología al servicio de la Formación … | My Blog

Leave a reply


Your email address will not be published.