PHPackages                             cmpayments/crate - 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. cmpayments/crate

ActiveLibrary

cmpayments/crate
================

A tool to simplify building PHARs.

v1.0.0(10y ago)520MITPHPPHP &gt;=5.3.3

Since Mar 25Pushed 6y agoCompare

[ Source](https://github.com/cmpayments/crate)[ Packagist](https://packagist.org/packages/cmpayments/crate)[ Docs](https://github.com/cmpayments/crate)[ RSS](/packages/cmpayments-crate/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (13)Versions (2)Used By (0)

Crate
=====

[](#crate)

[![Build Status](https://camo.githubusercontent.com/6cf266d868b5c53a8981f94c64271c42fc21333f18f778f1fe2c309402ee0b70/68747470733a2f2f7472617669732d63692e6f72672f636d7061796d656e74732f63726174652e737667)](https://travis-ci.org/cmpayments/crate)

What is it?
-----------

[](#what-is-it)

Crate is based on [Box](https://github.com/box-project/box2) and aims to simplifiy the Phar building process. Out of the box (no pun intended), the application can do many great things:

- Add, replace, and remove files and stubs in existing Phars.
- Extract a whole Phar, or cherry pick which files you want.
- Retrieve information about the Phar extension, or a Phar file.
    - List the contents of a Phar.
- Verify the signature of an existing Phar.
- Generate RSA (PKCS#1 encoded) private keys for OpenSSL signing.
    - Extract public keys from existing RSA private keys.
- Use Git tags and short commit hashes for versioning.

Since the application is based on the [Crate library](https://github.com/cmtelecom/crate-lib), you get its benefits as well:

- On the fly search and replace of placeholders.
- Compact file contents based on file type.
- Generate custom stubs.

Difference between Box and Crate
--------------------------------

[](#difference-between-box-and-crate)

The Box project aims to be cross-platform, while Crate has a Linux focus. Effectively this means that Linux specific features are more likely to find their way into Crate

How do I get started?
---------------------

[](#how-do-i-get-started)

You can use Crate in one of three ways:

### As a Phar (Recommended)

[](#as-a-phar-recommended)

You may download a ready-to-use version of Crate as a Phar:

```
$ curl -LSs https://cmpayments.github.io/crate/installer.php | php
```

The command will check your PHP settings, warn you of any issues, and the download it to the current directory. From there, you may place it anywhere that will make it easier for you to access (such as `/usr/local/bin`) and chmod it to `755`. You can even rename it to just `crate` to avoid having to type the `.phar` extension every time.

```
$ crate --version
```

Whenever a new version of the application is released, you can simply run the `update` command to get the latest version:

```
$ crate update
```

### As a Global Composer Install

[](#as-a-global-composer-install)

This is probably the best way when you have other tools like phpunit and other tools installed in this way:

```
$ composer global require cmpayments/crate --prefer-source
```

### As a Composer Dependency

[](#as-a-composer-dependency)

You may also install Crate as a dependency for your Composer managed project:

```
$ composer require --dev cmpayments/crate
```

(or)

```
{
    "require-dev": {
        "cmpayments/crate": "~1.0"
    }
}
```

> Be aware that using this approach requires additional configuration steps to prevent Crate's own dependencies from accidentally being added to your Phar, causing file size bloat.

Once you have installed the application, you can run the `help` command to get detailed information about all of the available commands. This should be your go-to place for information about how to use Crate. If you happen to come across any information that could prove to be useful to others, the wiki is open for you to contribute.

```
$ crate help
```

Creating a Phar
---------------

[](#creating-a-phar)

To get started, you may want to check out the [example application](https://github.com/kherge/php-crate-example) that is ready to be built by Crate. How your project is structured is entirely up to you. All that Crate requires is that you have a file called `crate.json` at the root of your project directory. You can find a complete and detailed list of configuration settings available by seeing the help information for the `build` command:

```
$ crate help build
```

> You may find example configuration files for popular projects on the wiki.

Once you have configured your project using `crate.json` (or `crate.json.dist`), you can simply run the `build` command in the directory containing `crate.json`:

```
$ crate build -v
```

> The `-v` option enabled verbose output. This will provide you with a lot of useful information for debugging your build process. Once you are satisfied with the results, I recommend not using the verbose option. It may considerably slow down the build process.

Contributing
------------

[](#contributing)

You can contribute in one of three ways:

1. File bug reports using the [issue tracker](https://github.com/cmpayments/crate/issues).
2. Answer questions or fix bugs on the issue tracker.
3. Contribute new features or update the wiki.

> The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.2% 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

Unknown

Total

1

Last Release

3703d ago

### Community

Maintainers

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

---

Top Contributors

[![kherge](https://avatars.githubusercontent.com/u/9122157?v=4)](https://github.com/kherge "kherge (202 commits)")[![cordoval](https://avatars.githubusercontent.com/u/328359?v=4)](https://github.com/cordoval "cordoval (4 commits)")[![smatyas](https://avatars.githubusercontent.com/u/534550?v=4)](https://github.com/smatyas "smatyas (3 commits)")[![empi89](https://avatars.githubusercontent.com/u/158283?v=4)](https://github.com/empi89 "empi89 (3 commits)")[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (2 commits)")[![pborreli](https://avatars.githubusercontent.com/u/77759?v=4)](https://github.com/pborreli "pborreli (2 commits)")[![baspeters](https://avatars.githubusercontent.com/u/1016795?v=4)](https://github.com/baspeters "baspeters (2 commits)")[![ickbinhier](https://avatars.githubusercontent.com/u/2810904?v=4)](https://github.com/ickbinhier "ickbinhier (1 commits)")[![jojosch](https://avatars.githubusercontent.com/u/327488?v=4)](https://github.com/jojosch "jojosch (1 commits)")[![fabpot](https://avatars.githubusercontent.com/u/47313?v=4)](https://github.com/fabpot "fabpot (1 commits)")[![kherrera-ebsco](https://avatars.githubusercontent.com/u/25376904?v=4)](https://github.com/kherrera-ebsco "kherrera-ebsco (1 commits)")[![mbrodala](https://avatars.githubusercontent.com/u/5037116?v=4)](https://github.com/mbrodala "mbrodala (1 commits)")[![mhor](https://avatars.githubusercontent.com/u/4103719?v=4)](https://github.com/mhor "mhor (1 commits)")[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (1 commits)")[![christiaan](https://avatars.githubusercontent.com/u/118490?v=4)](https://github.com/christiaan "christiaan (1 commits)")[![sasezaki](https://avatars.githubusercontent.com/u/42755?v=4)](https://github.com/sasezaki "sasezaki (1 commits)")[![flip111](https://avatars.githubusercontent.com/u/2244480?v=4)](https://github.com/flip111 "flip111 (1 commits)")[![hason](https://avatars.githubusercontent.com/u/288535?v=4)](https://github.com/hason "hason (1 commits)")

---

Tags

phar

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cmpayments-crate/health.svg)

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

###  Alternatives

[infection/infection

Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.

2.2k26.2M1.8k](/packages/infection-infection)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[humbug/box

Fast, zero config application bundler with PHARs.

1.3k801.5k69](/packages/humbug-box)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19462.3M1.3k](/packages/drupal-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)

PHPackages © 2026

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