laminas / laminas-component-installer

Composer plugin for injecting modules and configuration providers into application configuration
https://docs.laminas.dev/laminas-component-installer/
BSD 3-Clause "New" or "Revised" License
27 stars 12 forks source link

latest 2.3.1 release introduced bug #18

Closed svycka closed 4 years ago

svycka commented 4 years ago

Bug Report

Q A
Version(s) 2.3.1

Summary

no longer can use commands like:

composer why bla/bla
composer check
.... maybe more

Current behavior

$ composer check -vvv
Reading ./composer.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/var/www/html): git branch -a --no-color --no-abbrev -v
Failed to initialize global composer: Composer could not find the config file: /root/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Reading /var/www/html/vendor/composer/installed.json
Loading plugin PackageVersions\Installer
Loading plugin Laminas\ComponentInstaller\ComponentInstaller
Loading plugin Laminas\DependencyPlugin\DependencyRewriterPluginDelegator
Activating Laminas\DependencyPlugin\DependencyRewriterV2
Running 2.0.2 (2020-10-25 23:03:59) with PHP 7.4.11 on Linux / 5.4.0-47-generic
> pre-command-run: Laminas\DependencyPlugin\DependencyRewriterPluginDelegator->onPreCommandRun
In Laminas\DependencyPlugin\DependencyRewriterV2::onPreCommandRun

  [LogicException]                               
  A package can only be added to one repository  

Exception trace:
 () at phar:///usr/local/bin/composer/src/Composer/Package/BasePackage.php:136
 Composer\Package\BasePackage->setRepository() at phar:///usr/local/bin/composer/src/Composer/Repository/ArrayRepository.php:194
 Composer\Repository\ArrayRepository->addPackage() at phar:///usr/local/bin/composer/src/Composer/Repository/ArrayRepository.php:41
 Composer\Repository\ArrayRepository->__construct() at phar:///usr/local/bin/composer/src/Composer/Repository/RootPackageRepository.php:28
 Composer\Repository\RootPackageRepository->__construct() at phar:///usr/local/bin/composer/src/Composer/Command/CheckPlatformReqsCommand.php:65
 Composer\Command\CheckPlatformReqsCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:245
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:835
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:185
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:309
 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:121
 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:63
 require() at /usr/local/bin/composer:24

check-platform-reqs [--no-dev]

Expected behavior

$ composer check
composer-plugin-api   2.0.0       success  
composer-runtime-api  2.0.0       success  
ext-ctype             7.4.11      success  
ext-curl              7.4.11      success  
...
weierophinney commented 4 years ago

Fixed with #19