kherge / box
A tool to simplify building PHARs.
Requires
- php: >=5.3.3
- herrera-io/annotations: ~1.0
- herrera-io/box: ~1.6
- herrera-io/json: ~1.0
- justinrainbow/json-schema: ~1.3
- kherge/amend: ~3.0
- phine/path: ~1.0
- phpseclib/phpseclib: ~2.0
- symfony/console: ~2.1 || ~3.0
- symfony/finder: ~2.1 || ~3.0
- symfony/process: ~2.1 || ~3.0
Requires (Dev)
- herrera-io/phpunit-test-case: 1.*
- mikey179/vfsstream: 1.1.0
- phpunit/phpunit: 3.7.*
Suggests
- ext-openssl: To accelerate private key generation.
- dev-master / 3.x-dev
- 2.7.5
- 2.7.4
- 2.7.3
- 2.7.2
- 2.7.1
- 2.7.0
- 2.6.1
- 2.6.0
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.4
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.0
- 2.2.1
- 2.2.0
- 2.1.0
- 2.0.0
- 2.0.0-rc.2
- 2.0.0-rc.1
- 2.0.0-beta.2
- 2.0.0-beta.1
- 2.0.0-alpha.4
- 2.0.0-alpha.3
- 2.0.0-alpha.2
- 2.0.0-alpha.1
- 1.0.x-dev
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 1.0.0-rc.4
- 1.0.0-rc.3
- 1.0.0-rc.2
- 1.0.0-rc.1
- 1.0.0-beta.4
- 1.0.0-beta.3
- 1.0.0-beta.2
- 1.0.0-beta.1.3
- 1.0.0-beta.1.2
- 1.0.0-beta.1.1
- 1.0.0-beta.1
- 1.0.0-alpha.7
- 1.0.0-alpha.6
- 1.0.0-alpha.5
- 1.0.0-alpha.4
- 1.0.0-alpha.3
- 1.0.0-alpha.2
- 1.0.0-alpha.1
This package is auto-updated.
Last update: 2020-11-09 01:43:38 UTC
README
This project has been moved to https://github.com/box-project/box
If you are looking to upgrade, don't forget to have a look at the upgrade guide.
Box
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, 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
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.
How do I get started?
You can use Box in one of three ways:
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
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
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.
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. 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
To get started, you may want to check out the example application 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
You can contribute in one of three ways:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
- 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
You can find kherge's GPG on keybase.io.
32E4 B747 57B1 D652 34FC 389F 293D 7712 4151 5FE8