Composer : Loading specific ‘tags’ instead of ‘branches’

The beauty of composer comes to play when we want to have a custom fork of a software, say hosted in Github to be autoloaded. Again, introducing composer to people who are new:-
Quoting from https://getcomposer.org/doc/00-intro.md

Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you.

The docs tells exactly how to load a developement branch, using the dev- prefix (https://getcomposer.org/doc/05-repositories.md#vcs)
Problem:
* You want to load a custom release tag version from Github
+ You want to load release tag – 5.0-patch from Github repo of monolg
Solution:
* Edit the composer.json
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/igorw/monolog"
}
],
"require": {
"monolog/monolog": "5.0-patch"
}
}

* save it, run $ composer update
There you go ! 🙂 Thanks

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s