Skip to content

Generate a final BOX configuration file

Before to compile your PHP Archive (PHAR) with the BOX tool, you need to have a BOX configuration file that :

  • identify all manifest files to include as binary files with files-bin setting.
  • (optionally but recommended) store manifest files in a directory rather than in root archive with map setting.

Tip

You can complete an existing configuration file, rather than building a new one from scratch.

Don't forget to specify option --config /path/to/any-box.json on following command invocations.

Store manifests in default directory

box-manifest make configure

Here, we supposed to have previously generated console-table.txt and manifest.txt resources.

{
    "files-bin": [
        "console-table.txt",
        "manifest.txt",
        ".box.manifests.bin",
    ],
    "map": [
        {
            "console-table.txt": ".box.manifests/console-table.txt"
        },
        {
            "manifest.txt": ".box.manifests/manifest.txt"
        }
    ],
    "stub": null
}

Store manifests in a directory rather than in root archive

box-manifest make --resource-dir '.my_manifests/' configure

Here, we supposed to have previously generated console-table.txt and manifest.txt resources.

{
    "files-bin": [
        "console-table.txt",
        "manifest.txt",
        ".box.manifests.bin",
    ],
    "map": [
        {
            "console.txt": ".my_manifests/console.txt"
        },
        {
            "manifest.txt": ".my_manifests/manifest.txt"
        }
    ],
    "stub": null
}

Tip

If you want to keep your manifests store in root of the PHP Archive, please specify --resource-dir '/'

Identify the PHAR bootstrapping file (stub BOX setting)

To do so, you have to specify --output-stub option with filename that should be previously built (or not).

box-manifest make --resource-dir '.my_manifests/' --output-stub app-fixtures-stub.php configure

Here, we supposed to have previously generated console-table.txt and manifest.txt resources.

{
    "files-bin": [
        "console-table.txt",
        "manifest.txt",
        ".box.manifests.bin",
    ],
    "map": [
        {
            "console.txt": ".my_manifests/console.txt"
        },
        {
            "manifest.txt": ".my_manifests/manifest.txt"
        }
    ],
    "stub": "app-fixtures-stub.php"
}