PHP Composer mixed with Git Submodules and Symfony2 PHP Composer mixed with Git Submodules and Symfony2 symfony symfony

PHP Composer mixed with Git Submodules and Symfony2


I would say your best bet is to add those components via composer as opposed to git submodules. It makes coding and maintenance a bit more complex, but it ensures that your application is aware for all the actual dependencies.

If you don't want them to be public and want an easier way to handle them, then i would roll out a Satis deploy locally and register them all there, adding that satis repo to your composer.json.

Satis is a simpler version of Packagist, as long as the server with it, and the machines that run composer install have access to your private repositories, nothing else will see them. There is documentation on the Composer website at: https://getcomposer.org/doc/articles/handling-private-packages-with-satis.md

You will then setup packages.yourcompany.com and add it to your composer.json as an alternate source of packages. Everything stays private.

Reply to Edit:This is happening because composer compartimentalizes, which means the "repository" is only known to your project's composer.json, the one in Repo A does not know, so it cannot find it. You must re-define the repository in that one. Even using Satis the "satis" address must be added to all composer.json files involved.

Add the "repository" stuff you added in your app to the composer.json in Repo A and B, it should work it all out.


I think this maybe sounds a bit similar to what you want to do, so I thought I'd post the link in case was helpful and you hadn't already seen it How do I use a Git submodule with a Composer loaded library?


You should use a .gitignore file containing something like that:

    web/bundles/    app/cache/*    app/logs/*    app/sessions/*    build/    vendor

When developing you should launch php composer.phar update from time to time. When your work is validated, you should commit the composer.lock file with your development.

When deploying, you can then just launch php composer.phar install.