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

Require command unable to detect latest stable #3900

Closed
stevelacey opened this issue Apr 1, 2015 · 3 comments
Closed

Require command unable to detect latest stable #3900

stevelacey opened this issue Apr 1, 2015 · 3 comments

Comments

@stevelacey
Copy link

Composer seems to be unable to detect the latest stable release when running:

composer require beberlei/DoctrineExtensions

But the following does work:

composer require beberlei/DoctrineExtensions "~1.0"

Packagist and other services seems seem happy that 1.0.1 is the latest stable, but the require command isn't happy? Wondering if it's to do with the v tag prefix?

https://github.com/beberlei/DoctrineExtensions/issues/145

@stevelacey stevelacey changed the title Unable to detect latest stable Require command unable to detect latest stable Apr 1, 2015
@alcohol
Copy link
Member

alcohol commented Apr 8, 2015

Found out why; this line returns false, because the array index of providerListing is lowercased while $name is not.

@Seldaek can you confirm that the providerListing array always has lowercase indexes, and if so, if a simple strtolower on $name would be a sufficient enough approach to tackle this issue?

Edit: another way to confirm this suspicion, running

composer require beberlei/doctrineextensions

works just fine.

@stof
Copy link
Contributor

stof commented Apr 8, 2015

composer package names are always lowercased. ComposerRepository->whatProvides() is fine if it expects receiving a lowercase name already (doing a lowercase each time would impact the performance of the solver, which calls this method many times with names being lowercase already). the require command should be fixed to lowercase the argument

@alcohol
Copy link
Member

alcohol commented Apr 8, 2015

I'll get right on that.

alcohol added a commit to alcohol/composer that referenced this issue Apr 8, 2015
alcohol added a commit to alcohol/composer that referenced this issue Apr 8, 2015
@Seldaek Seldaek closed this as completed in 117b7ea Apr 8, 2015
Danack added a commit to Danack/composer that referenced this issue Dec 14, 2015
* master: (66 commits)
  Fix regression with non-SPDX licenses in show command, refs composer#3885
  Add comment about --, refs composer#3853
  [bugfix] Fixed undefined var in DiagnoseCommand::execute().
  Add BC method for old usage, refs composer#3857
  Update contributing
  Add multiline_array_tailing_comma fix
  Add PHPCSFixer config
  CS fixes
  Update changelog
  Ignore all .git dirs in the vendor dir recursively
  Link to semver version constraint tester
  Fix typo in aliases.md
  [bugfix] Updated ```DiagnoseCommand::execute()``` and ```DiagnoseCommand::getGithubRateLimit()```
  Silence symlink() error
  Fixes composer#3900
  Remove unused variable
  Unused variable
  Fix composer#3903
  Readme: 00-intro - use __DIR__
  Update 04-schema.md
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants