Reputation: 14578
I want to reuse a bundle, eg: Company/CommonBundle
So what I need to know is how to turn a bundle created with 'php app/console generate:bundle', into a vendor bundle, installable through Composer, and versioned with git.
There seems to be a convention for vendors names, eg: 'monolog/monolog/src/Monolog'. Is there a guide for that?
Upvotes: 2
Views: 309
Reputation: 14578
All right I figured this out
1) uninstall the newly created bundle and move it somewhere else
2) create a git or hg repository for it, commit and push
3) add the dependency to your project, in composer.json
4) run 'composer update nothing'
That's it. Composer downloaded the repository, so you can modify it as needed, commit/push and make it available to all your other projects by following 3) and 4). If the bundle is already installed, you update it like this: 'composer update mybundle'. Enjoy.
Now all I need to figure out is how to have the bundle auto-added to AppKernel.php, etc. If you find how to do this, please share it.
Upvotes: 1