10up / 10up-code-review

Custom PHP_CodeSniffer rules to help flag common issues during code review
43 stars 5 forks source link

Can't install globally with Composer #1

Closed morganestes closed 8 years ago

morganestes commented 8 years ago

I followed the instructions for installing globally with Composer, but keep getting an error about an invalid version string.

[UnexpectedValueException]
  Could not parse version constraint 10up/10up-code-review.git: Invalid version string "10up/
  10up-code-review.git"

I'm not sure where I'm going wrong on this, as it's the first time I've used Composer to install a package globally, and it's possible that there's something wonky with my local setup.

stevegrunwell commented 8 years ago

It's not your environment, it's a bad set of instructions based on assumptions I've made: When Composer reads a colon (":") in a URL (for instance, a GItHub repo) it assumes everything that follows is the version, which is obviously not the case.

There are a couple ways we can get around this:

  1. Add the private repository to our global composer.json file (though this is still causing conflicts with minimum versions for me):

    $ composer global config repositories.10up-code-review vcs git@github.com:10up/10up-code-review.git
  2. Get permission to open up the repository and publish it on Packagist so it can be installed via 10up/10up-code-review :wink:

Thanks for bringing this to my attention, I'll try to get it sorted out as soon as I can and update the documentation accordingly.

stevegrunwell commented 8 years ago

We were able to get Leadership's approval to open this up and publish to Packagist, so route 2 would be the way to go :)