Last Updated: December 30, 2020
·
2.786K
· jverdeyen

Develop Symfony2 bundles without github/packagist

Core purpose

Developing a new bundle inside an existing/new Symfony2 project isn't well documented.
I don't want to keep pushing/pulling from packagist/github on every single change.

Let's say your bundle development is located in /home/user/newBundle/ and you want to start using and developing it in /home/user/myProject/.

Edit composer.json

Add the following to your /home/user/myProject/composer.json in your project.

"repositories": [
        { "type": "vcs", "url": "/home/user/newBundle/" }
    ]
"require": {
   "mybundles/new-bundle": "*"
}

Remarks

Make sure you already have valid composer.json in your newBundle, more info About packagist

Make sure you commit every change, otherwise composer will complain there is no composer.json found in any branch

Update composer package

composer update mybundles/new-bundle

You should be pulling the bundle from your local repo path now.

Live editing from the source

If you don't want to run composer update on every change, you could symlink your /home/user/newBundle/ to the location in your vendor directory.

3 Responses
Add your response

Just deleted the post like that about the same practice. It seems that devopment in vendor directory is more effective.

over 1 year ago ·

I've also been struggling for while on finding the most convenient way of doing this. For now, this little hack is helping me. It feels "against the rules" because you're editing in the "never ever ever ever touch/edit" - vendor dir :)

over 1 year ago ·

Update on topic: https://github.com/linkorb/autotune for composer developers

over 1 year ago ·