How to make composer's dependency commited?

I am using composer to manage the dependencies of 2 symfony2 projects. Since these 2 projects have some things in common, I created a (private) shared package that is required in both composer.json

Here is my composer.json:

{ "name": "symfony/framework-standard-edition", "description": "The \"Symfony Standard Edition\" distribution", "repositories": [ { "type": "vcs", "url": " git@git.local :commonbundle.git" } ], "require": { "php": ">=5.3.3", "symfony/symfony": "2.2.*", "doctrine/orm": ">=2.2,<3.0,>=2.2.3", "doctrine/doctrine-bundle": "1.2.*", "twig/extensions": "1.0.*", "symfony/assetic-bundle": "2.1.*", "symfony/swiftmailer-bundle": "2.2.*", "symfony/monolog-bundle": "2.2.*", "sensio/distribution-bundle": "2.2.*", "sensio/framework-extra-bundle": "2.2.*", "sensio/generator-bundle": "2.2.*", "jms/security-extra-bundle": "1.4.*", "jms/di-extra-bundle": "1.3.*", "kriswallsmith/assetic": "1.1.*@dev", "doctrine/common": "2.4.*@dev", "doctrine/data-fixtures": "dev-master", "doctrine/doctrine-fixtures-bundle": "dev-master", "gmp/common-bundle" : "dev-master" }, "scripts": { "post-install-cmd": [ "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile" ], "post-update-cmd": [ "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile" ] }, "extra": { "symfony-app-dir": "app", "symfony-web-dir": "web", "symfony-assets-install": "symlink", "branch-alias": { "dev-master": "2.2-dev" } } } 

This works great. But I would like to be able to make changes to the overall package of my two projects.

My point: the general package is not independent and does not work autonomously. This is just a convenient way not to duplicate classes between my two projects. Thus, changes in the general package always come from one of my two projects. How can I make a shared package commit from my projects?

+4
source share
2 answers

When you start the composer installation in one of your main projects, if you use --prefer-source, you should be able to burn the CD to the vendor directory of your general package, make changes and transfer them back.

+2
source

Can you add the commonbundle repository to each project as a submodule of git?

 cd /path/to/Proj1 git submodule add path/to/commonbundle commonbundle git commit -m "added submodule" [repeat for Proj 2] 
0
source

All Articles