PHPackages                             kherge/box - 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. kherge/box

Abandoned → [humbug/box](/?search=humbug%2Fbox)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

kherge/box
==========

A tool to simplify building PHARs.

2.7.5(9y ago)1.2k101.0k↓25%77[15 issues](https://github.com/box-project/box2/issues)[6 PRs](https://github.com/box-project/box2/pulls)20MITPHPPHP &gt;=5.3.3

Since Jul 18Pushed 5y ago45 watchersCompare

[ Source](https://github.com/box-project/box2)[ Packagist](https://packagist.org/packages/kherge/box)[ Docs](http://box-project.github.io/box2/)[ RSS](/packages/kherge-box/feed)WikiDiscussions 2.0 Synced 1mo ago

READMEChangelog (10)Dependencies (13)Versions (60)Used By (20)

This project has been moved to

If you are looking to upgrade, don't forget to have a look at the [upgrade guide](https://github.com/box-project/box/blob/master/UPGRADE.md#from-27-to-30).

---

Box
===

[](#box)

[![Build Status](https://camo.githubusercontent.com/ed950415fdd15ea6bfe7443acdfa55cc254ded643bdcd2ab4c8f4bbfd120c525/68747470733a2f2f7472617669732d63692e6f72672f626f782d70726f6a6563742f626f78322e7376673f6272616e63683d322e30)](https://travis-ci.org/box-project/box2)

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

[](#what-is-it)

The Box application simplifies 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 [Box library](https://github.com/herrera-io/php-box), you get its benefits as well:

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

Forks
-----

[](#forks)

Because of the lack of proper maintenance on my part, I created a wiki page to list the known forks of this project. Please feel free to add to this list. [You can find the wiki page here.](https://github.com/box-project/box2/wiki/Forks)

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

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

You can use Box in one of three ways:

### As a Phar (Recommended)

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

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

```
$ curl -LSs https://box-project.github.io/box2/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 `box` to avoid having to type the `.phar` extension every time.

```
$ box --version
```

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

```
$ box 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 kherge/box --prefer-source
```

### As a Composer Dependency

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

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

```
$ composer require --dev kherge/box
```

(or)

```
{
    "require-dev": {
        "kherge/box": "~2.5"
    }
}
```

> Be aware that using this approach requires additional configuration steps to prevent Box's own dependencies from accidentally being added to your Phar, causing file size bloat. You can find more information about this [issue on the wiki](https://github.com/kherge/php-box/wiki/App%2C-or-Library%3F).

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 Box. You may also find additional useful information [on the wiki](https://github.com/kherge/php-box/wiki). If you happen to come across any information that could prove to be useful to others, the wiki is open for you to contribute.

```
$ box help
```

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

[](#creating-a-phar)

To get started, you may want to check out the [example application](https://github.com/kherge/php-box-example) that is ready to be built by Box. How your project is structured is entirely up to you. All that Box requires is that you have a file called `box.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:

```
$ box help build
```

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

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

```
$ box 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/kherge/php-box/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.

GPG Signature
-------------

[](#gpg-signature)

You can find [kherge's GPG on keybase.io](https://keybase.io/kherge).

```
32E4 B747 57B1 D652 34FC 389F 293D 7712 4151 5FE8

```

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity53

Moderate usage in the ecosystem

Community44

Growing community involvement

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 87.4% 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 ~27 days

Recently: every ~70 days

Total

59

Last Release

3445d ago

Major Versions

1.0.x-dev → 2.0.0-alpha.12013-03-20

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9122157?v=4)[Kevin Herrera](/maintainers/kherge)[@kherge](https://github.com/kherge)

---

Top Contributors

[![kherge](https://avatars.githubusercontent.com/u/9122157?v=4)](https://github.com/kherge "kherge (209 commits)")[![cordoval](https://avatars.githubusercontent.com/u/328359?v=4)](https://github.com/cordoval "cordoval (4 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 (3 commits)")[![smatyas](https://avatars.githubusercontent.com/u/534550?v=4)](https://github.com/smatyas "smatyas (3 commits)")[![theofidry](https://avatars.githubusercontent.com/u/5175937?v=4)](https://github.com/theofidry "theofidry (2 commits)")[![mbrodala](https://avatars.githubusercontent.com/u/5037116?v=4)](https://github.com/mbrodala "mbrodala (2 commits)")[![pborreli](https://avatars.githubusercontent.com/u/77759?v=4)](https://github.com/pborreli "pborreli (2 commits)")[![keradus](https://avatars.githubusercontent.com/u/2716794?v=4)](https://github.com/keradus "keradus (1 commits)")[![hason](https://avatars.githubusercontent.com/u/288535?v=4)](https://github.com/hason "hason (1 commits)")[![kherrera-ebsco](https://avatars.githubusercontent.com/u/25376904?v=4)](https://github.com/kherrera-ebsco "kherrera-ebsco (1 commits)")[![fabpot](https://avatars.githubusercontent.com/u/47313?v=4)](https://github.com/fabpot "fabpot (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)")[![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)")

---

Tags

phar

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kherge-box/health.svg)

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

###  Alternatives

[composer/composer

Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.

29.4k187.2M2.6k](/packages/composer-composer)[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[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)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[humbug/box

Fast, zero config application bundler with PHARs.

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

PHPackages © 2026

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