5

I'm trying to add a missing feature to a bundle. Here is what I've done so far:

  • Spoke to the project owner and got their approval
  • Created a fork and cloned it locally into a directory outside of my project
  • Made a feature branch
  • Ran composer install

Now, the question is, how can I include this into my own Symfony project so that it would be autoloaded? I want to test my changes inside my own project before I send a pull request.

Parham Doustdar
  • 2,019
  • 3
  • 22
  • 41

2 Answers2

6

See How to require a fork with composer, to be specific, require a VCS repository as described in Composer docs

Or a bit faster way for improving developing process (which is independent on Github), try using local repositories.

Community
  • 1
  • 1
Tomas Votruba
  • 23,240
  • 9
  • 79
  • 115
  • So my workflow would be to add my repository to `composer.json`, and then edit->`git commit`->`git push`->`composer update`->test->repeat? – Parham Doustdar Jul 07 '15 at 08:09
  • Yes. There is also faster way [using local repositories](http://www.glatter-gotz.com/blog/2014/04/09/php-composer-working-with-local-repositories/) (I've added it to my answer). – Tomas Votruba Jul 07 '15 at 08:23
3

You can archive in two manner:

  1. You can hack the vendor folder replacing the folder of the bundle with a symlink of the third-party bundle
  2. [RECOMENDED] Put in the composer.json file of your project the reference of your personal github project instead of the official version
Matteo
  • 37,680
  • 11
  • 100
  • 115
  • I've voted for the other answer, but I admit that more often than not I use the trick of the symlink in the `vendor/` directory. – Javier Eguiluz Jul 07 '15 at 10:36
  • Hi @JavierEguiluz i also voted for the other answer: more complete and documented. I read also the ability to do the same trick via composer with the [artifact](https://getcomposer.org/doc/05-repositories.md#artifact) options! – Matteo Jul 07 '15 at 10:41