Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues in require/init when dealing with virtual packages which do not exist #10541

Merged
merged 2 commits into from Feb 16, 2022

Conversation

Seldaek
Copy link
Member

@Seldaek Seldaek commented Feb 16, 2022

Fixes #10489

  • composer require psr/log-implementation:* now works
  • composer require psr/log-implementation (without constraint) prompts for a version:
$ c req psr/log-implementation
Package "psr/log-implementation" does not exist but is provided by 124 packages. Which version constraint would you like to use? [*] ^2
Using version ^2 for psr/log-implementation
./composer.json has been updated
Running composer update psr/log-implementation
  • composer init when searching for virtual packages also checks for providers and if one is found the provided name is added to the list of matches from the package search (previously only xxnoobmanxx/psrlogger was suggested here)
Define your dependencies.


Would you like to define your dependencies (require) interactively [yes]? Search for a package:
Would you like to define your dev dependencies (require-dev) interactively [yes]?
Search for a package: psr/log-implementation

Found 2 packages matching psr/log-implementation

   [0] psr/log-implementation
   [1] xxnoobmanxx/psrlogger

Enter package # to add, or the complete package name if it is not listed:

cc @dzuelke

@Seldaek Seldaek added the Bug label Feb 16, 2022
@Seldaek Seldaek added this to the 2.2 milestone Feb 16, 2022
@Seldaek Seldaek merged commit 7ee44e6 into composer:2.2 Feb 16, 2022
@Seldaek Seldaek deleted the init_req_fixes branch February 16, 2022 15:05
@dzuelke
Copy link
Contributor

dzuelke commented Feb 17, 2022

Amazing. Thanks for the work; I've run it through my integration tests (code used manual composer.json update and then composer update … before), and it looks like this does the job splendidly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants