Currently it's not possible to autoinstall pie just using composer.json/composer.lock file.
Current behavior
Create a composer.json file, e.g. with following content:
{
"name": "1m9/php-build",
"type": "example",
"require": {
"php": ">=8.0",
"ext-apcu": "*",
"ext-redis": "*"
}
}
After that run composer install --ignore-platform-reqs to generate composer.lock file.
To install pie extensions, you need to run pie install in same folder. Pie is now (happily for security reasons) asking, which extension we want to install, e.g. apcu/apcu for ext-apcu.
Because of those user input requirements it's not possible to autoinstall pie extensions, e.g. in container environment.
Solution
Add an additional section, e.g. extensions, which is loading all relevant meta data for required extensions (not just the package & version, but also the additional pie flags (--with-xyz, ...).
Example
{
"name": "1m9/php-build",
"type": "example",
"extensions": {
"apcu/apcu": "*",
"phpredis/phpredis": {
"version": "*",
"flags": ["--with-xyz", "--without-xyz", "--enable-xyz", "--whatever..."]
}
},
"require": {
"php": ">=8.0",
"ext-apcu": "*",
"ext-redis": "*"
}
}
Currently it's not possible to autoinstall pie just using
composer.json/composer.lockfile.Current behavior
Create a composer.json file, e.g. with following content:
{ "name": "1m9/php-build", "type": "example", "require": { "php": ">=8.0", "ext-apcu": "*", "ext-redis": "*" } }After that run
composer install --ignore-platform-reqsto generatecomposer.lockfile.To install pie extensions, you need to run
pie installin same folder. Pie is now (happily for security reasons) asking, which extension we want to install, e.g.apcu/apcuforext-apcu.Because of those user input requirements it's not possible to autoinstall pie extensions, e.g. in container environment.
Solution
Add an additional section, e.g.
extensions, which is loading all relevant meta data for required extensions (not just the package & version, but also the additionalpieflags (--with-xyz, ...).Example
{ "name": "1m9/php-build", "type": "example", "extensions": { "apcu/apcu": "*", "phpredis/phpredis": { "version": "*", "flags": ["--with-xyz", "--without-xyz", "--enable-xyz", "--whatever..."] } }, "require": { "php": ">=8.0", "ext-apcu": "*", "ext-redis": "*" } }