Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID

Installing a fork using Composer

edited April 2013 in Install Help

If you want to contribute to the code for any of the app packages, the relatively easy way is to install them first via composer and fork them on github. It took me a little bit of digging to figure out how to install my own fork of a composer project and get it loaded, so Just a quick how to if you're interested:

First fork the app repository in github so you have your own copy. Then following the instructions here: http://www.elefantcms.com/wiki/Using-Composer-packages , setup your composer packages for the apps like the example:

{
    "require": {
        "merk/Dough": "*",
        "elefant/app-assetic": "*",
        "elefant/app-form": "*",
        "elefant/theme-montreal": "*"
    },
    "config": {
        "vendor-dir": "lib/vendor"
    }
}

And then add a list of the repositories to the file to point to your forked repos:

{
    "repositories": [
        { "type": "vcs", "url": "git@github.com:<YOUR_ACCOUNT>/assetic" },
        { "type": "vcs", "url": "git@github.com:<YOUR_ACCOUNT>/form" }
    ],
    "require": {
        "merk/Dough": "*",
        "elefant/app-assetic": "*",
        "elefant/app-form": "*",
...

I haven't tested the alternatives, but I think it's important to use the ssh flavor of the repo url. On my system, running composer update then clones two repos: a readonly repo named composer and a read/write repo named origin. Origin is setup to track your github repo and you should checkout origin/master or better checkout a new origin/develop branch to work in (I personally prefer using git flow). Composer needs that local repo named composer, so you can't delete or rename it.

Make sure you commit your code, and push your commits to github, before your next composer update. I haven't been doing this for very long, so I don't know where the pitfalls are. Github has some good info on the Pull Request cycle.

Comments

  • Cool use of composer, I didn't know it could handle alternate repos of existing packages like that. Thanks for sharing!

Sign In or Register to comment.