Introduction To The Compiler
The build process converts your application's source code into an executable optimized for the production environment.
This requires a boson-php/compiler
component that is supplied separately from the boson-php/runtime
.
Installation
Requirements:
PHP ^8.4
Compilation Process
The process of building an application consists of several consecutive steps:
The first step is to try to read the
boson.json
configuration file.Next, all settings explicitly passed to the console command arguments are applied; for example, the
--platform=macos
argument will explicitly override configuration"platform"
field value.Next, the application is assembled into a single phar archive. The archive is placed in the output directory.
Next, the PHP runtime, application code and settings are compiled into a single executable file.
The final step is to move the built application and its dependencies to the appropriate build directory.
Usage
Compiler package provides a command line tool that can be executed with the php vendor/bin/boson
command. For example, you can run the list
command to get information about the capabilities of the console utility.
Then the output result will be approximately the same as on the screen