This script is a simple automation on checking extensions status with the upcoming PHP 8 release.
Content about extension's PHP 8 support:
As in any modern PHP project, dependencies are handled by composer.
To install dependencies, run composer install
.
All OS support (i.e. enable/disable) is handled by $osMatrix
here.
The currently supported OSes are alpine
and buster
, from the tags available in the official PHP Docker Image.
For a given OS, one may add the following instructions:
-
Pre-build commands to be executed, by adding commands to
$osSpecs[<os-name>]['pre']
list (e.g. here). -
Build dependencies to be installed, by adding:
All PHP version is handled by $phpVerMatrix
here.
One possible future improvement is to decouple variants (i.e. zts
, cli
, fpm
) from version, by spliting $phpVerMatrix
into two, but at this point this is simple enough to work with.
This is the actual core of the script, where one can add/remove extensions and it is all handled by $extList
here.
For a given extension, one may add the following instructions:
-
Build dependencies to be installed, by adding:
- OS-Specific dependencies to
$extList[<ext-name>]['deps'][<os-name>]
list (e.g. here); - OS-Independant dependencies to
$extList[<ext-name>]['deps']
list.
- OS-Specific dependencies to
-
Build commands to be executed, by adding commands to
$extList[<ext-name>]['make']
list (e.g. here).
The build path is the directory where the script will output all docker-related files, it is recomended to be a temporary directory (such as /tmp
) and this is handled by $buildPath
here.
Once everything is set, execute the script by running php ./builder.php
.
The output should look like this:
$ php builder.php
Creating build files for PHP v8.0.0beta4@alpine
-> Building decimal...
-> Status: FAIL
-> Building parallel...
-> Status: FAIL
-> Building pcov...
-> Status: FAIL
Creating build files for PHP v8.0.0beta4@buster
-> Building decimal...
-> Status: FAIL
-> Building parallel...
-> Status: FAIL
-> Building pcov...
-> Status: FAIL
Creating build files for PHP v8.0.0beta4-zts@alpine
-> Building decimal...
-> Status: FAIL
-> Building parallel...
-> Status: FAIL
-> Building pcov...
-> Status: FAIL
Creating build files for PHP v8.0.0beta4-zts@buster
-> Building decimal...
-> Status: FAIL
-> Building parallel...
-> Status: FAIL
-> Building pcov...
-> Status: FAIL