smoreno
smoreno

Reputation: 3530

Symfony2: How can I maintain and continue developing a shared bundle?

I have a symfony project in which I develop a corebundle for sharing it with other related apps. I know that in order to share it that I have to move the bundle to a new repo and add as it as composer dependency in both projects. But how can I maintain and continue developing the bundle if now is not part of any project directly?

Upvotes: 1

Views: 114

Answers (1)

nixoschu
nixoschu

Reputation: 544

First part of your question:

You're right, if you want to create a bundle and "share" it between different projects you need to encapsle it from your current project and create an own repository for it.

I assume you are using git arent you ?

So you could use Satis to

  • have a better control over versions of your corebundle
  • make it easier to add it to your composer.json

If you dont want to install your own Satis service you could (like you said) just add your new repository as a source to your composer.json and reference the bundle.

About the second part of your question.

If you installed your bundle as a vendor you can edit this bundle like any other code. Now if you want to push this code, you can access the sub repository that was created inside of the vendor folder of your corebundle

for example : /vendor/myname/mycorebundle/MyCoreBundle/

You can also just clone the corebundle itself into a new project (without any other project around it) and edit the code there.

If you do so, you need either to update the bundle via composer or make a pull inside the sub repository inside of the vendor folder of your corebundle in the project you want to have the changes

hope i could explained it well enough

Upvotes: 2

Related Questions