{"id":13518961,"url":"https://github.com/box-project/box","last_synced_at":"2025-05-13T16:07:14.592Z","repository":{"id":36963889,"uuid":"109533757","full_name":"box-project/box","owner":"box-project","description":"📦🚀 Fast, zero config application bundler with PHARs.","archived":false,"fork":false,"pushed_at":"2025-04-21T19:04:55.000Z","size":11543,"stargazers_count":1197,"open_issues_count":62,"forks_count":104,"subscribers_count":26,"default_branch":"main","last_synced_at":"2025-04-23T21:51:52.906Z","etag":null,"topics":["archive","command-line","console-application","phar","php"],"latest_commit_sha":null,"homepage":"https://box-project.github.io/box","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/box-project.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yaml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["theofidry"]}},"created_at":"2017-11-04T22:06:27.000Z","updated_at":"2025-04-22T14:07:26.000Z","dependencies_parsed_at":"2023-12-21T13:59:26.774Z","dependency_job_id":"f565a6f4-0b1b-4cc0-9ccc-95c59f2291b3","html_url":"https://github.com/box-project/box","commit_stats":{"total_commits":1055,"total_committers":55,"mean_commits":"19.181818181818183","dds":0.5800947867298578,"last_synced_commit":"25cb3017cec3e01e57c7f807b0a30d6ac8c62060"},"previous_names":["humbug/box"],"tags_count":134,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box-project%2Fbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box-project%2Fbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box-project%2Fbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box-project%2Fbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/box-project","download_url":"https://codeload.github.com/box-project/box/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253979991,"owners_count":21994041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["archive","command-line","console-application","phar","php"],"created_at":"2024-08-01T05:01:51.360Z","updated_at":"2025-05-13T16:07:14.545Z","avatar_url":"https://github.com/box-project.png","language":"PHP","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"doc/img/box.png\" width=900 alt=\"Box logo\" /\u003e\n\u003c/p\u003e\n\n\n[![Package version](https://img.shields.io/packagist/v/humbug/box.svg?style=flat-square)](https://packagist.org/packages/humbug/box)\n[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/humbug/box.svg?branch=master\u0026style=flat-square)](https://scrutinizer-ci.com/g/humbug/box/?branch=master)\n[![Slack](https://img.shields.io/badge/slack-%23humbug-red.svg?style=flat-square)](https://symfony.com/slack-invite)\n[![License](https://img.shields.io/badge/license-MIT-red.svg?style=flat-square)](LICENSE)\n\nUpgrading from [Box2][box2]? Checkout the [upgrade guide](UPGRADE.md#from-27-to-30)!\n\n## Goal\n\nThe Box application simplifies the PHAR building process. Out of the box (no pun intended), the application can do many\ngreat things:\n\n- ⚡  Fast application bundling\n- 🔨 [PHAR isolation](doc/code-isolation.md#phar-code-isolation)\n- ⚙️ Zero configuration by default\n- 🚔 [Requirements checker](doc/requirement-checker.md#requirements-checker)\n- 🚨 Friendly error logging experience\n- 🔍 Retrieve information about the PHAR extension or a PHAR file and its contents (`box info` or `box diff`)\n- 🔐️ Verify the signature of an existing PHAR (`box verify`)\n- 📝 Use Git tags and short commit hashes for versioning\n- 🕵️️ Get recommendations and warnings about regarding your configuration (`box validate`)\n- 🐳 [Docker support (`box docker`)](doc/docker.md#docker-support)\n\nFor the full documentation see https://box-project.github.io/box.\n\n\n## Table of Contents\n\n1. [Installation](doc/installation.md#installation)\n    1. [Phive](doc/installation.md#phive)\n    1. [Composer](doc/installation.md#composer)\n    1. [Homebrew](doc/installation.md#homebrew)\n    1. [GitHub](doc/installation.md#github)\n    1. [Docker](doc/installation.md#docker)\n    1. [shivammathur/setup-php (GitHub Actions)](doc/installation.md#shivammathursetup-php-github-actions)\n1. [Usage](#usage)\n1. [Configuration][the configuration documentation]\n    1. [Base path (`base-path`)](doc/configuration.md#base-path-base-path)\n    1. [Main (`main`)](doc/configuration.md#main-main)\n    1. [Output (`output`)](doc/configuration.md#output-output)\n    1. [Permissions (`chmod`)](doc/configuration.md#permissions-chmod)\n    1. [Check requirements (`check-requirements`)](doc/configuration.md#check-requirements-check-requirements)\n    1. [Including files](doc/configuration.md#including-files)\n        1. [Force auto-discovery (`force-autodiscovery`)](doc/configuration.md#force-auto-discovery-force-autodiscovery)\n        1. [Files (`files` and `files-bin`)](doc/configuration.md#files-files-and-files-bin)\n        1. [Directories (`directories` and `directories-bin`)](doc/configuration.md#directories-directories-and-directories-bin)\n        1. [Finder (`finder` and `finder-bin`)](doc/configuration.md#finder-finder-and-finder-bin)\n        1. [Blacklist (`blacklist`)](doc/configuration.md#blacklist-blacklist)\n        1. [Excluding the Composer files (`exclude-composer-files`)](doc/configuration.md#excluding-the-composer-files-exclude-composer-files)\n        1. [Excluding dev files (`exclude-dev-files`)](doc/configuration.md#excluding-dev-files-exclude-dev-files)\n        1. [Map (`map`)](doc/configuration.md#map-map)\n    1. [Stub](doc/configuration.md#stub)\n        1. [Stub (`stub`)](doc/configuration.md#stub-stub)\n        1. [Alias (`alias`)](doc/configuration.md#alias-alias)\n        1. [Shebang (`shebang`)](doc/configuration.md#shebang-shebang)\n        1. [Banner (`banner`)](doc/configuration.md#banner-banner)\n        1. [Banner file (`banner-file`)](doc/configuration.md#banner-file-banner-file)\n    1. [Forcing the timestamp (`timestamp`)](doc/configuration.md#forcing-the-timestamp-timestamp)\n    1. [Dumping the Composer autoloader (`dump-autoload`)](doc/configuration.md#dumping-the-composer-autoloader-dump-autoload)\n    1. [Compactors (`compactors`)](doc/configuration.md#compactors-compactors)\n        1. [Annotations (`annotations`)](doc/configuration.md#annotations-annotations)\n        1. [PHP-Scoper (`php-scoper`)](doc/configuration.md#php-scoper-php-scoper)\n    1. [Compression algorithm (`compression`)](doc/configuration.md#compression-algorithm-compression)\n    1. [Security](doc/configuration.md#security)\n        1. [Signing algorithm (`algorithm`)](doc/configuration.md#signing-algorithm-algorithm)\n        1. [The private key (`key`)](doc/configuration.md#the-private-key-key)\n        1. [The private key password (`key-pass`)](doc/configuration.md#the-private-key-password-key-pass)\n    1. [Metadata (`metadata`)](doc/configuration.md#metadata-metadata)\n    1. [Replaceable placeholders](doc/configuration.md#replaceable-placeholders)\n        1. [Replacements (`replacements`)](doc/configuration.md#replacements-replacements)\n        1. [Replacement sigil (`replacement-sigil`)](doc/configuration.md#replacement-sigil-replacement-sigil)\n        1. [Datetime placeholder (`datetime`)](doc/configuration.md#datetime-placeholder-datetime)\n        1. [Datetime placeholder format (`datetime-format`)](doc/configuration.md#datetime-placeholder-format-datetime-format)\n        1. [Pretty git commit placeholder (`git`)](doc/configuration.md#pretty-git-tag-placeholder-git)\n        1. [Git commit placeholder (`git-commit`)](doc/configuration.md#git-commit-placeholder-git-commit)\n        1. [Short git commit placeholder (`git-commit-short`)](doc/configuration.md#short-git-commit-placeholder-git-commit-short)\n        1. [Git tag placeholder (`git-tag`)](doc/configuration.md#git-tag-placeholder-git-tag)\n        1. [Git version placeholder (`git-version`)](doc/configuration.md#git-version-placeholder-git-version)\n1. [Requirements checker](doc/requirement-checker.md#requirements-checker)\n    1. [Configuration](doc/requirement-checker.md#configuration)\n        1. [PHP version requirements](doc/requirement-checker.md#php-version-requirements)\n        1. [Extension configuration requirements](doc/requirement-checker.md#extension-configuration-requirements)\n        1. [Polyfills](doc/requirement-checker.md#polyfills)\n    1. [Integration with a custom stub](doc/requirement-checker.md#integration-with-a-custom-stub)\n1. [Optimize your PHAR](doc/optimizations.md#optimize-your-phar)\n    1. [Review your files](doc/optimizations.md#review-your-files)\n    1. [Compress your PHAR](doc/optimizations.md#compress-your-phar)\n    1. [Optimize your code](doc/optimizations.md#optimize-your-code)\n1. [PHAR code isolation](doc/code-isolation.md#phar-code-isolation)\n    1. [Why/Explanation](doc/code-isolation.md#whyexplanation)\n    1. [Isolating the PHAR](doc/code-isolation.md#isolating-the-phar)\n    1. [Debugging the scoping](doc/code-isolation.md#debugging-the-scoping)\n1. [Docker support](doc/docker.md#docker-support)\n1. [Symfony support](doc/symfony.md#symfony-support)\n   1. [Project files](doc/symfony.md#project-files)\n   1. [Project directory](doc/symfony.md#project-directory)\n   2. [Cache](doc/symfony.md#cache)\n1. [Reproducible builds](doc/reproducible-builds.md#reproducible-builds)\n   1. [Creating a reproducible PHAR](doc/reproducible-builds.md#creating-a-reproducible-phar)\n      1. [PHP-Scoper](doc/reproducible-builds.md#php-scoper)\n      1. [Composer](doc/reproducible-builds.md#composer)\n          1. [Composer root version](doc/reproducible-builds.md#composer-root-version)\n          1. [Composer autoload suffix](doc/reproducible-builds.md#composer-autoload-suffix)\n      1. [Box](doc/reproducible-builds.md#box)\n          1. [PHAR alias](doc/reproducible-builds.md#phar-alias)\n          1. [Requirement Checker](doc/reproducible-builds.md#requirement-checker)\n          1. [Box banner](doc/reproducible-builds.md#box-banner)\n      1. [PHAR](doc/reproducible-builds.md#phar)\n   1. [Usages](doc/reproducible-builds.md#usages)\n1. [PHAR signing best practices](doc/phar-signing.md#phar-signing-best-practices)\n   1. [Built-in PHAR API](doc/phar-signing.md#built-in-phar-api)\n       1. [How to sign your PHAR](doc/phar-signing.md#how-to-sign-your-phar)\n       1. [How it works](doc/phar-signing.md#how-it-works)\n       1. [Why it is bad](doc/phar-signing.md#why-it-is-bad)\n   1. [How to (properly) sign your PHAR](doc/phar-signing.md#how-to-properly-sign-your-phar)\n       1. [Create a new GPG-key](doc/phar-signing.md#create-a-new-gpg-key)\n       1. [Manually signing](doc/phar-signing.md#manually-signing)\n       1. [Generate the encryption key](doc/phar-signing.md#generate-the-encryption-key)\n       1. [Secure your encryption key](doc/phar-signing.md#secure-your-encryption-key)\n       1. [Sign your PHAR](doc/phar-signing.md#sign-your-phar)\n       1. [Verifying the PHAR signature](doc/phar-signing.md#verifying-the-phar-signature)\n   1. [Automatically sign in GitHub Actions](doc/phar-signing.md#automatically-sign-in-github-actions)\n1. [FAQ](doc/faq.md#faq)\n   1. [What is the canonical way to write a CLI entry file?](doc/faq.md#what-is-the-canonical-way-to-write-a-cli-entry-file)\n       1. [The shebang](doc/faq.md#the-shebang)\n       1. [The PHP_SAPI check](doc/faq.md#the-php_sapi-check)\n       1. [Autoloading Composer](doc/faq.md#autoloading-composer)\n   2. [Detecting that you are inside a PHAR](doc/faq.md#detecting-that-you-are-inside-a-phar)\n   3. [Building a PHAR with Box as a dependency](doc/faq.md#building-a-phar-with-box-as-a-dependency)\n1. [Contributing](#contributing)\n1. [Upgrade guide](UPGRADE.md#upgrade-guide)\n1. [Backward Compatibility Promise (BCP)](#backward-compatibility-promise-bcp)\n1. [Credits](#credits)\n\n\n## Usage\n\nCreating a PHAR should be as simple as running `box compile` (**no config required!**). It will however assume some\ndefaults that you might want to change. Box will by default be looking in order for the files `box.json` and\n`box.json.dist` in the current working directory. A basic configuration could be for example changing the PHAR\npermissions:\n\n```json\n{\n    \"chmod\": \"0700\"\n}\n```\n\nYou can then find more advanced configuration settings in [the configuration documentation][configuration].\nFor more information on which command or options is available, you can run:\n\n```shell\nbox help\n```\n\n\n## Contributing\n\nThe project provides a `Makefile` in which the most common commands have been registered such as fixing the coding\nstyle or running the test.\n\n```bash\nmake\n```\n\n\n## Backward Compatibility Promise (BCP)\n\nThe policy is for the major part following the same as [Symfony's one][symfony-bc-policy]. Note that the code marked\nas `@private` or `@internal` are excluded from the BCP.\n\nThe 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.\n\n\n## Credits\n\nProject originally created by: [Kevin Herrera] ([@kherge]) which has now been moved under the [Humbug umbrella][humbug].\n\n\n[box2]: https://github.com/box-project/box2\n[configuration]: doc/configuration.md#configuration\n[Kevin Herrera]: https://github.com/kherge\n[@kherge]: https://github.com/kherge\n[humbug]: https://github.com/humbug\n[symfony-bc-policy]: https://symfony.com/doc/current/contributing/code/bc.html\n[the configuration documentation]: doc/configuration.md#configuration\n","funding_links":["https://github.com/sponsors/theofidry"],"categories":["PHP","目录","Table of Contents"],"sub_categories":["构建工具 Build Tools","Build Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbox-project%2Fbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbox-project%2Fbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbox-project%2Fbox/lists"}