Strategies
Default strategy
This strategy identify what resource (filename) is associated to a manifest and the target format to build.
Filename | Format | Mime Type |
---|---|---|
console-style.txt |
console-style |
application/octet-stream |
console-table.txt |
console-table |
application/octet-stream |
plain.txt or manifest.txt |
plain |
text/plain |
sbom.json or *.cdx.json |
sbom-json |
application/vnd.sbom+json |
sbom.xml or *.cdx.xml |
sbom-xml |
application/vnd.sbom+xml |
custom.bin |
User class | application/octet-stream |
PostInstall strategy
Never forget to update your manifests. This strategy is your best friend, each time you want to update your dependencies !
Note
Learn more with Composer Scripts feature, and how to configure it with extra data.
It's easier than running Box Manifest pipeline commands. Just add the following setting into your composer.json
project file.
{
"scripts": {
"post-update-cmd": "Bartlett\\BoxManifest\\Composer\\PostInstallStrategy::postUpdate"
}
}
Caution
Because BOX v4 will raise Fatal error: Cannot declare class Composer\InstalledVersions, because the name is already in use
,
please use the vendor/bin/composer
command installed with BOX Manifest rather than your Composer platform version.
Configuration
Option | Description | Default |
---|---|---|
box-project config-file |
BOX configuration file that must identify a map setting | box.json.dist |
box-project resource-dir |
Identify folder where your manifests are stored into the PHAR | .box.manifests/ |
Tip
box-project
> resource-dir
with null
value is equivalent to default directory .box.manifests/
For example:
{
"main": "bin/box-manifest",
"compression": "GZ",
"directories": ["bin", "src", "vendor"],
"directories-bin": [
"vendor/humbug/box/res/requirement-checker",
"resources"
],
"files": [
"autoload.php",
"bootstrap.php"
],
"files-bin": [
"vendor/humbug/php-scoper/vendor-hotfix/.gitkeep",
"console-table.txt",
"plain.txt",
"sbom.json",
".box.manifests.bin"
],
"stub": "stub.php",
"map": [
{ "console-table.txt": ".my-manifests/console-table.txt" },
{ "plain.txt": ".my-manifests/plain.txt" },
{ "sbom.json": ".my-manifests/sbom.json" }
],
"blacklist": [
"fixtures",
"tests",
"Test",
"doc",
"dist",
"vendor-bin"
]
}
console-table.txt
: Symfony Console Table formatplain.txt
: Plain text formatsbom.json
: CycloneDX SBOM JSON format