znlc-g
Last Updated: April 28, 2016
·
2.465K
· jverdeyen
E40b946f8a5d22e9c61629df7ab0111c

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.

Say Thanks
Respond

3 Responses
Add your response

7907

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

over 1 year ago ·
7908
E40b946f8a5d22e9c61629df7ab0111c

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 ·
27536

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

over 1 year ago ·