This repository was archived by the owner on Mar 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Adding Platform Config to composer.json
Aaron Zinck edited this page Oct 2, 2019
·
2 revisions
Composer's config.platform option is used to tell Composer about the PHP environment that the packages will be running in. This differs from the current environment since we use a Composer-specific image to perform composer install commands. The config.platform option allows us to tell Composer about the platform dependencies without specifying --ignore-platform-reqs.
The structure of the platform config is "ext-<extension>": "<version". Composer doesn't seem to care about the version number for built-in extensions, so we just use "1.0.0" everywhere.
- First, update the file (see the two sections below for what config you should add).
- Run
composer update --lock. Composer will capture the platform config. - Make sure the update has not introduced any breaking changes.
- Commit and push. You can now freely forget that
--ignore-platform-reqsexists.
For Drupal projects, you'll need to advertise three extensions: GD, Opcache, and PDO:
{
"config": {
"platform": {
"ext-gd": "1.0.0",
"ext-opcache": "1.0.0",
"ext-pdo": "1.0.0"
}
}
}WordPress only requires the MySQLi extension:
{
"config": {
"platform": {
"ext-mysqli": "1.0.0"
}
}
}- Drupal:
505de3ad5e - WordPress:
3429a3b159