Skip to content

Commit ce5588c

Browse files
authored
Merge pull request #107 from TYPO3GmbH/task/version-ranges-1.5.x
2 parents 2d11d82 + bf688e7 commit ce5588c

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ jobs:
3838
if: ${{ matrix.composer-versions == 'v1' }}
3939
run: composer require "composer/composer:^1.10" --dev --no-update
4040

41+
- name: Require Composer@v2
42+
if: ${{ matrix.composer-versions == 'v2' }}
43+
run: composer require "composer/composer:^2.0" --dev --no-update
44+
4145
- name: Install composer dependencies
4246
run: composer install
4347

src/Installer/ExtensionInstaller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ public function installBinary(PackageInterface $package)
276276
protected function installCode(PackageInterface $package)
277277
{
278278
$downloadPath = $this->getInstallPath($package);
279-
if (version_compare(Composer::RUNTIME_API_VERSION, '2.0.0') < 0) {
279+
if (!defined('Composer\Composer::RUNTIME_API_VERSION') || version_compare(Composer::RUNTIME_API_VERSION, '2.0.0') < 0) {
280280
return $this->downloadManager->download($package, $downloadPath);
281281
}
282282
return $this->downloadManager->install($package, $downloadPath);

src/Installer/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function activate(Composer $composer, IOInterface $io)
8383
$cache = new Cache($io, $composer->getConfig()->get('cache-files-dir'), 'a-z0-9_./');
8484
}
8585

86-
if (version_compare(Composer::RUNTIME_API_VERSION, '2.0.0') < 0) {
86+
if (!defined('Composer\Composer::RUNTIME_API_VERSION') || version_compare(Composer::RUNTIME_API_VERSION, '2.0.0') < 0) {
8787
$t3xDownloader = new Downloader\T3xDownloader($io, $composer->getConfig(), null, $cache);
8888
} else {
8989
$httpDownloader = new HttpDownloader($io, $composer->getConfig());

tests/Installer/Downloader/T3xDownloaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class T3xDownloaderTest extends InstallerTestCase
2929
public function testDownloaderCompatibility()
3030
{
3131
$io = new BufferIO();
32-
if (version_compare(Composer::RUNTIME_API_VERSION, '2.0.0') < 0) {
32+
if (!defined('Composer\Composer::RUNTIME_API_VERSION') || version_compare(Composer::RUNTIME_API_VERSION, '2.0.0') < 0) {
3333
$t3xDownloader = new T3xDownloader($io, $this->composer->getConfig());
3434
} else {
3535
$httpDownloader = new HttpDownloader($io, $this->composer->getConfig());

0 commit comments

Comments
 (0)