1
0
Fork 0

[docs] add vcs repo section to repos chapter

pull/319/head
Igor Wiedler 2012-02-20 01:04:35 +01:00
parent c8f3fa5800
commit cabe1c2949
2 changed files with 39 additions and 2 deletions

View File

@ -252,6 +252,8 @@ Example:
}
```
> **Note:** Order is significant here. Repositories added later will take precedence. This also means that custom repositories can override packages that exist on packagist.
You can also disable the packagist repository by setting `packagist` to `false`.
```json

View File

@ -45,7 +45,7 @@ The main repository type is the `composer` repository. It uses a single `package
}
```
The `@composer.json` is the `composer.json` of that package version including as a minimum:
The `@composer.json` marker would be the contents of the `composer.json` from that package version including as a minimum:
* name
* version
@ -70,8 +70,43 @@ The `composer` repository is also what packagist uses. To reference a `composer`
### VCS
VCS stands for version control system. This includes versioning systems like git, svn or hg. Composer has a repository type for installing packages from these systems.
There are a few use cases for this. The most common one is maintaining your own fork of a third party library. If you are using a certain library for your project and you decide to change something in the library, you will want your project to use the patched version. If the library is on GitHub (this is the case most of the time), you can simply fork it there and push your changes to your fork. After that you update the project's `composer.json`. All you have to do is add your fork as a repository and update the version constraint to point to your custom branch.
Example assuming you patched monolog to fix a bug in the `bugfix` branch:
```json
{
"repositories": [
{
"type": "vcs",
"url": "http://github.com/igorw/monolog"
}
],
"require": {
"monolog/monolog": "dev-bugfix"
}
}
```
When you run `php composer.phar update`, you should get your modified version of `monolog/monolog` instead of the one from packagist.
Git is not the only version control system supported by the VCS repository. The following are supported:
* **Git:** [git-scm.com](http://git-scm.com)
* **Subversion:** [subversion.apache.org](http://subversion.apache.org)
* **Mercurial:** [mercurial.selenic.com](http://mercurial.selenic.com)
To use these systems you need to have them installed. That can be invonvenient. And for this reason there is special support for GitHub and BitBucket that use the APIs provided by these sites, to fetch the packages without having to install the version control system. The VCS repository provides `dist`s for them that fetch the packages as zips.
* **GitHub:** [github.com](https://github.com) (Git)
* **BitBucket:** [bitbucket.org](https://bitbucket.org) (Git and Mercurial)
The VCS driver to be used is detected automatically based on the URL.
### PEAR
### Package
## Hosting your own
## Hosting your own