πŸ“¦πŸš€ Fast, zero config application bundler with PHARs.
Pull request Compare This branch is 367 commits ahead, 53 commits behind box-project:master.
theofidry Update PHP-Scoper (#328)
From 0.11.3 to 0.11.4.
Latest commit d2a2a7f Nov 13, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.docker Ship a constraint checker to the built PHARs (#116) Apr 22, 2018
.github Add tap release configuration (#280) Sep 19, 2018
.requirement-checker Dump the requirement checker (#322) Nov 8, 2018
bin Apply the blacklist to the retrieved directories from the composer.js… May 3, 2018
doc Rework the PHP compactor (#315) Nov 8, 2018
fixtures Add support for PhpScoper files whitelisting (#319) Nov 6, 2018
requirement-checker Bump dependencies (#313) Oct 31, 2018
res Rework the PHP compactor (#315) Nov 8, 2018
src Add a deprecation message when the legacy compactors are being used (#… Nov 12, 2018
tests Add a deprecation message when the legacy compactors are being used (#… Nov 12, 2018
vendor-bin CS & tweaks (#308) Oct 31, 2018
.gitignore Add support for PhpScoper files whitelisting (#319) Nov 6, 2018
.php_cs.dist Update dependencies (#274) Sep 10, 2018
.php_cs_53.dist Ship a constraint checker to the built PHARs (#116) Apr 22, 2018
.travis.yml Make some UI tweaks (#288) Oct 7, 2018
LICENSE Updating year on license. Mar 15, 2013
Makefile Add support for PhpScoper files whitelisting (#319) Nov 6, 2018
README.md Fix various elements in the doc (#296) Oct 9, 2018
UPGRADE.md Rework the PHP compactor (#315) Nov 8, 2018
box.json.dist Fix the configuration recommendations (#327) Nov 13, 2018
composer.json Rework the PHP compactor (#315) Nov 8, 2018
composer.lock Update PHP-Scoper (#328) Nov 13, 2018
infection.json.dist Harden the tests (#237) May 25, 2018
phpcs.xml.dist CS & tweaks (#308) Oct 31, 2018
phpunit.xml.dist Add recommendations and warnings (#283) Sep 23, 2018
psalm.xml Fix some issues reported by Psalm (#184) Apr 30, 2018
scoper.inc.php Rework the PHP compactor (#315) Nov 8, 2018

README.md

Package version Travis Build Status Scrutinizer Code Quality Slack License

Fork of the unmaintained box2 project. This project needs your help!

Upgrading from Box2? Checkout the upgrade guide!

Goal

The Box application simplifies the PHAR building process. Out of the box (no pun intended), the application can do many great things:

  • ⚑ Fast application bundling
  • πŸ”¨ PHAR isolation
  • βš™οΈ Zero configuration by default
  • πŸš” Requirements checker
  • 🚨 Friendly error logging experience
  • πŸ” Retrieve information about the PHAR extension or a PHAR file and its contents (box info or box diff)
  • πŸ”οΈ Verify the signature of an existing PHAR (box verify)
  • πŸ“ Use Git tags and short commit hashes for versioning
  • πŸ•΅οΈοΈ Get recommendations and warnings about regarding your configuration
  • 🐳 Docker support (box docker)

Table of Contents

  1. Installation
    1. PHAR
    2. Phive
    3. Composer
    4. Homebrew
  2. Usage
  3. Configuration
    1. Base path
    2. Main
    3. Output
    4. Permissions
    5. Check requirements
    6. Including files
      1. Force auto-discovery (force-autodiscovery)
      2. Files (files and files-bin)
      3. Directories (directories and directories-bin)
      4. Finder (finder and finder-bin)
      5. Blacklist (blacklist)
      6. Map (map)
    7. Stub
      1. Stub (stub)
      2. Alias (alias)
      3. Shebang (shebang)
      4. Banner (banner)
      5. Banner file (banner-file)
    8. Dumping the Composer autoloader (dump-autoload)
    9. Excluding the Composer files (exclude-composer-files)
    10. Compactors (compactors)
      1. Annotations (annotations)
      2. PHP-Scoper (php-scoper)
    11. Compression algorithm (compression)
    12. Security
      1. Signing algorithm (algorithm)
      2. The private key (key)
      3. The private key password (key-pass)
    13. Metadata (metadata)
    14. Replaceable placeholders
      1. Replacements (replacements)
      2. Replacement sigil (replacement-sigil)
      3. Datetime placeholder (datetime)
      4. Datetime placeholder format (datetime-format)
      5. Pretty git commit placeholder (git)
      6. Git commit placeholder (git-commit)
      7. Short git commit placeholder (git-commit-short)
      8. Git tag placeholder (git-tag)
      9. Git version placeholder (git-version)
  4. Requirements checker
    1. Configuration
      1. PHP version requirements
      2. Extension configuration requirements
      3. Polyfills
    2. Integration with a custom stub
  5. Optimize your PHAR
    1. Review your files
    2. Compress your PHAR
    3. Optimize your code
  6. PHAR code isolation
    1. Why/Explanation
    2. Isolating the PHAR
    3. Debugging the scoping
  7. Docker support
  8. Contributing
  9. Upgrade guide
  10. Backward Compatibility Promise (BCP)
  11. Credits

Usage

Creating a PHAR should be as simple as running box compile (no config required!). It will however assume some defaults that you might want to change. Box will by default be looking in order for the files box.json and box.json.dist in the current working directory. A basic configuration could be for example changing the PHAR permissions:

{
    "chmod": "0700"
}

You can then find more advanced configuration settings in the configuration documentation. For more information on which command or options is available, you can run:

box help

Contributing

The project provides a Makefile in which the most common commands have been registered such as fixing the coding style or running the test.

make

Backward Compatibility Promise (BCP)

The policy is for the major part following the same as Symfony's one. Note that the code marked as @private or @internal are excluded from the BCP.

The text displayed by the commands (e.g. compile or info) or the content of the error/exception messages are also not subject to the BCP.

Credits

Project originally created by: Kevin Herrera (@kherge) which has now been moved under the Humbug umbrella.