Question

I am working on a project where code will be shared across multiple projects. Right now, I maintain the shared code in a single sf2 application that are in the same SVN repository. What is the recommended/right way to pull out the shared bundles from that app, so that I can maintain is separately and use it in multiple projects.

Are symlinks a good way to do this? What would be the best approach for this?

This is my current project tree structure with the bundles/modules that needs to be shared later on:

[project is owner] src/Mango/API/RestBundle
[shared]           src/Mango/CoreDomain
[shared]           src/Mango/CoreDomainBundle

I want to be able to pull out the shared bundles/modules and maintain them in a separate SVN repo.

Était-ce utile?

La solution

Use Composer

Put every bundle that needs to be shared between multiple projects in it's own repository, and use Composer to manage your dependencies (which are the bundles, because your main project depends on them).

As your bundles are probably private, and not meant to be reused by others, you don't want to add them to Packagist. Instead, you can reference the SVN repository directly:

Your main project's composer.json:

{
    "require": {
        "vendor/my-private-repo": "dev-master"
    },
    "repositories": [
        {
            "type": "vcs",
            "url":  "git@bitbucket.org:vendor/my-private-repo.git"
        }
    ]
}

See the Composer documentation for more information.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top