Skip to content

Commit

Permalink
bump composer to v2.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronFeledy committed Nov 26, 2024
1 parent c0da37e commit a015cf6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

* Added logic to allow default `composer` version to be set based on PHP version.
* Set default `composer` version to `2.8.2`
* Set default `composer` version to `2.8.3`
* Set default `composer` version to `2.2.24` for PHP 5.3-7.2
* Set default `composer` version to `1.10.27` for PHP <= 5.2
* Fixed bug causing `composer` 2.2.x to be installed when `composer_version` was set to a single digit version such as `1`
Expand Down
12 changes: 9 additions & 3 deletions builders/php.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ const path = require('path');
const semver = require('semver');
const addBuildStep = require('./../utils/add-build-step');

const composerVersions = {
'1': '1.10.27',
'2': '2.8.3',
'2.2': '2.2.24',
};

/**
* Get the appropriate Composer version based on the PHP version.
* @param {string} phpVersion - The PHP version.
Expand All @@ -19,13 +25,13 @@ const getDefaultComposerVersion = phpVersion => {

if (semver.lt(phpVersion, '5.3.2')) {
// Use Composer 1 for PHP < 5.3.2
return '1';
return composerVersions['1'];
} else if (semver.lt(phpVersion, '7.3.0')) {
// Use Composer 2.2 LTS for PHP < 7.3
return '2.2.24';
return composerVersions['2.2'];
} else {
// Use Composer 2 for PHP >= 7.3
return '2.8.2';
return composerVersions['2'];
}
};

Expand Down

0 comments on commit a015cf6

Please sign in to comment.