kherge/box
Box is a PHP tool for building PHAR archives, letting you package PHP applications and libraries into a single executable file. It provides configuration-driven builds, file compaction, and reproducible output for easy distribution.
.phar? A phar collapses "install PHP, install Composer, resolve deps, fight extensions" into php tool.phar, which is a real support-cost reduction for customers and field engineers.build.php that concatenates files, strips comments, and stubs the Phar class. Box gives you a declarative config, file inclusion/exclusion, stub generation, compacting, and signing in one place. This is a decision about paying a small integration cost now versus owning a fragile internal build script forever.Consider it when:
box.json) rather than a bespoke build script, and you're willing to vendor or fork the tool to keep it running.Look elsewhere when:
box-project/box (Box2) is the maintained successor and should be the default. Also evaluate phar-composer for Composer-driven builds, php-scoper when you need namespace isolation to avoid dependency conflicts inside the phar, and Laravel Zero's built-in app:build if the tool is already a Laravel Zero app.Phar API edge cases, and OpenSSL/signature handling. Do not plan a PHP 8 upgrade on top of this dependency.For executives (one paragraph): We evaluated Box as a way to package our PHP command-line tooling into a single distributable file. The business value is reduced installation friction and lower support load — customers run one file instead of provisioning Composer and resolving dependencies, which matters most in locked-down and air-gapped accounts. The caveat is lifecycle: this specific package was last released in 2016 and is archived, so it is a pattern we should adopt, not this artifact. Recommendation: adopt single-file phar distribution as a delivery mechanism, and standardize on the actively maintained successor (Box2) rather than this repository. Migration cost is low and mostly configuration-level.
For engineering leads: Box's model — declarative box.json, stub generation, file inclusion rules, compaction, signing — is the right abstraction and worth copying conceptually. But pinning new work to a 2016 codebase means owning PHP 8 incompatibilities, stale OpenSSL signing paths, and no upstream security response. Use box-project/box as the default, add php-scoper if dependency namespace collisions are a risk, and keep the build reproducible and checksummed in CI. If a legacy product line already ships Box-built phars, leave it alone, document the frozen toolchain, and schedule migration alongside — not before — the next PHP runtime upgrade.
For product/roadmap: Treat "single-file CLI distribution" as a capability we're investing in, gated on two decisions: (1) is source confidentiality a requirement? If yes, phar is the wrong tool and we should scope a licensing/obfuscation evaluation instead; (2) which product lines still need pre-PHP-8 packaging? That answer tells us whether Box is a migration target or a decommission target. Neither answer requires new headcount this quarter — this is a build-pipeline decision, not a platform bet.
How can I help you explore Laravel packages today?