How to install your own bundle with Composer in Symfony 2.1?

IlyaDoroshin picture IlyaDoroshin · Aug 22, 2012 · Viewed 10.9k times · Source

I've just moved to Symfony 2.1, and I can't understand, how can I install my own bundles with Composer?

It was very easy in 2.0.x in deps:

[MyOwnBundle]
  [email protected]:weboshin_cms_bundle.git
  target=/bundles/My/OwnBundle

After that I just triggered bin/vendors update and that was it!

But now there's no deps file, and I supposed to do everything with Composer. Please give me any hints.

Answer

IlyaDoroshin picture IlyaDoroshin · Aug 23, 2012

I've found the answer.

// my_project/compose.json:
{
    "repositories": [
        {
            "type": "vcs",
            "url": "own_repository_url"
        }
    ],

    // ...

    "require": {
        // ...
        "own/bundle": "dev-master"
    }
},

 

// own_repository/own_bundle/compose.json:
{
    "name": "own/bundle"
}