Ideal Situation
Often while working on a Symfony2 project I will spot something I want to change in one of my dependencies. If I could find a way to simply change it in vendor and then easily push the changes as a pull request then I would probably contribute more often (rather than overriding the part with a local child bundle).
The Problem
I can't change a vendor directory without composer freaking out on the next update. If I submit a pull request then it may take quite some time before I can actually use the code in vendors, which is actually a deterrent from contributing my new functionality.
How I do it now
The way I typically contribute to a bundle is to make a fork, put the fork in a barebones symfony standard-edition app, make the change and then submit a pull request.
Put fork in composer.json
?
The only solution I can think of, is removing the packagist dependency of the bundle I am editing, and then including my fork with composer (as a package) from github. That way I get my code immediately and can still contribute.
Is this the only solution? How do you do it?
Any tips/advice for contributing to a bundle while working on a different project at the same time would be appreciated!
Nah... this is broken.
I've tried the official way to include a fork, here's an example (original:kitano, fork: jstoeffler) of the composer.json :
(For those who are in a hurry: THIS DOESNT WORK)
"repositories": [ //... { "type": "vcs", "url": "https://github.com/jstoeffler/KitanoConnectionBundle", }, //... ],
It keeps using the original bundle. Don't know what the problem is, and I don't get how everything works, but here's how I successfully add a fork to a project.
"repositories": [ //... { "type": "package", "package": { "name": "kitano/connection-bundle", "version": "dev-master", "source": { "url": "https://github.com/jstoeffler/KitanoConnectionBundle.git", "type": "git", "reference": "master" }, "autoload": { "classmap": [""] } } }, //... ],
[UPDATE: Answer Not Valid Anymore]
As pointed out in one of the comments, this answer is a couple years old and not correct anymore. See answers below for the correct way to proceed.
[Original answer below]
This is the approach recommended by Jordi Boggiano (@Seldaek), creator of composer. See from his talk at Symfony Live San Francisco earlier this year (at the 2 minutes mark): http://www.youtube.com/watch?list=PLo7mBDsRHu11ChvScWUE7MN1Qo5QVHQEz&feature=player_detailpage&v=P3NwF8RV1lY#t=120s
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With