BOSON Help

Compiler Configuration

To create a build configuration, use the init command. The command will create the boson.json file in the root of the application with build settings. It is not required for compilation, but allows better control over all stages of the build.

{ // // The name of your application. // [[["name": "app",|#config-name]]] // // List of build architectures. // [[["arch": [ "amd64", "aarch64" ],|#config-arch]]] // // List of build platforms. // [[["platform": [ "windows", "linux", "macos" ],|#config-platform]]] // // An application entrypoint PHP file. // [[["entrypoint": "index.php",|#config-entrypoint]]] // // An output build directory. // [[["output": "./build",|#config-output]]] // // List of rules for including files inside the assembly. // [[["build": {|#build-config]]] "finder": [ { "directory": "vendor", "name": "*.php" }, { "directory": "vendor/boson-php/runtime/resources/dist", "name": "*.js" } ] }, // // Additional options for the PHP interpreter // [[["ini": {|#ini-config]]] "memory_limit": "128M" } }

name

The name of your application.

It is used to create output executable file. For example, if you specify "name": "example", the example.exe application will be created for the Windows platform (and example binaries for others).

{ "name": "application name", // ... }

arch

List of build architectures.

You can explicitly specify the CPU architectures your application will be built for.

Available options:

  • amd64 (or x86_64)

  • aarch64 (or arm64)

{ "arch": [ "amd64", "aarch64" ], // ... }

platform

List of build platforms.

You can explicitly specify a list of operating systems for which your application will be compiled.

Available options:

  • windows (or win/win32/win64)

  • linux

  • macos (or darwin)

{ "platform": [ "windows", "linux", "macos" ], // ... }

entrypoint

An application entrypoint PHP file.

In the entrypoint field, you should specify the relative path to the file that will be executed when the application is launched.

{ "entrypoint": "path/to/entrypoint.php", // ... }

output

An output build directory.

The relative path is specified in which all assembly files and the result of the assembly itself will be placed.

{ "build": "./var/build", // ... }

build

List of rules for including files inside the assembly.

This field contains an object with a set of rules. Available fields of the object:

  • "files" - List of files to include.

  • "directories" - List of directories to include.

  • "finder" - List of rules (filters) to include.

build.files

The "files" section specifies a list (array) of individual files to include in the assembly.

{ "build": { "files": [ "./path/to/file.php", "./some/awesome.jpg", // ... ], // ... }, // ... }

build.directories

The "directories" section specifies a list (array) of directories to include in the assembly.

{ "build": { "directories": [ "./public", "./resources", // ... ], // ... }, // ... }

build.finder

The "finder" section specifies a list (array) of finder-like rules to include in the assembly.

{ "build": { "finder": [ { // "string" or ["string"] "directory": "vendor", // "string" or ["string"] "not-directory": "vendor/phpunit", // "string" or ["string"] "name": "*.php", // "string" or ["string"] "not-name": "Test.php" }, // ... ], // ... }, // ... }

The "finder" may contain an array of objects with, "name", "not-name", "directory" and "not-directory" fields.

name field format

Filters files by name. All files matching the specified rule will be included in the build.

  1. You may specify a mask where an asterisk means any occurrence of any number of characters

    *.php
    index*
  2. You can specify a regular expression to check the file name. Such an expression must start and end with the / characters.

    /\.php$/
    /^index.*/

directory field format

Specifies the directory in which to search for files to include.

  1. You may define real path to directory.

    ./path/to/directory
  2. You may use * as a wildcard character to search in the directories matching a pattern (each pattern has to resolve to at least one directory path).

    ./path/to/*/*/dir

ini

Additional options for the PHP interpreter.

You can specify additional options for the interpreter using the settings object.

The key should be one of the available directive names. The value may be any scalar (int, float, string or bool) value.

{ "ini": { "memory_limit": "128M", "opcache.jit_buffer_size": "32M" } }
10 July 2025