5avwkg
Last Updated: February 25, 2016
·
5.15K
· erivello

Use my own fork of a third party library with Composer

If you need to use your fork of a third party library in a project managed with Composer, don't submit this fork to packagist but add your fork as a repository and update the version constraint to point to your custom branch.

Example (with Github):

{
    "repositories": [
        {
            "type": "vcs",
            "url": "http://github.com/erivello/third-party-library"
        }
    ],
    "require": {
        ....
        "foobar/third-party-library": "dev-fork"
        ....
    }
}

Now you can get the third-party-library from your Github instead of the one from packagist.

3 Responses
Add your response

11529

really not clear: what is erivello forked or not?
what is foobar? forked or not?
is dev-fork branch or what?

over 1 year ago ·
11533

"foobar/third-party-library" is the original library and "dev-fork" is the branch i need.
"erivello/third-party-library" is my fork of "dev-fork" branch.

So when i run "php composer.phar update", i should get my modified version of "foobar/third-party-library"

over 1 year ago ·
12730

cool, thanks

over 1 year ago ·