JustinP
JustinP

Reputation: 1401

Symfony2 composer.json "repositories" — What is driving the fetched Version?

I'm trying to use the twitter/bootstrap repository without taking advantage of http://packagist.org. The below composer.json works fine to get the tag 2.1.1, but as you can see, I've referenced version 2.1.1 3 times. This seems overly redundant. My question is :

What variable is driving the the desired version of bootstrap repo to be fetched? Should I be using master somewhere then only 2.1.1 in on other place?

composer.json snip below:

"require": {
        "twitter/bootstrap": "2.1.1"
    },
"repositories": [
    {
     "type": "package",
     "package": {
     "version": "2.1.1",
      "name": "twitter/bootstrap",
      "source": {
         "url": "https://github.com/twitter/bootstrap.git",
         "type": "git",
         "reference": "v2.1.1"
     }
   }
 }
]

Upvotes: 4

Views: 932

Answers (1)

Elnur Abdurrakhimov
Elnur Abdurrakhimov

Reputation: 44841

  • reference is the real object of a repository — like a tag.
  • version is how you call it for referencing from the require section.
  • The one in the require section is a pattern to match against the version value. You could set it to 2.1.* or 2.* to make it less restrictive.

Upvotes: 3

Related Questions