Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I correctly declare a Dependency to another Bundle within a Bundle?

I am trying to use a Bundle inside a Bundle but somehow it is failig.

"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/myname/mybundle"
    }
],
"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.1.*",
    (...)
    "myname/mybundle": "*"
},

this seems to work so far. But I can't figure out how to declare another dependency within "myname/mybundle".

I tried the following in the composer.json file of myname/mybundle but none of them worked :(

"repositories": [
    {
        "type": "vcs",
        "url": "url": "https://github.com/drymek/PheanstalkBundle"
    }
],
"require": {
    (...)
    "drymek/PheanstalkBundle": "dev-master"
}

and

"repositories": [
    {
        "type": "package",
        "package": {
            "name": "drymek/PheanstalkBundle",
            "version": "dev-master",
            "source": {
                "url": "https://github.com/drymek/PheanstalkBundle.git",
                "type": "git",
                "reference": "master"
            }
        }
    }
],
"require": {
    (...)
    "drymek/PheanstalkBundle": "dev-master"
}

when I rum composer.phar update all i get is

- myname/mybundle dev-master requires drymek/pheanstalkbundle dev-master -> no matching package found.

like image 647
Senči Avatar asked Sep 14 '12 12:09

Senči


1 Answers

Okay I've found an answer here

It states: Repositories are not resolved recursively. You can only add them to your main composer.json. Repository declarations of dependencies' composer.jsons are ignored.

That's too bad... but now at least I know where to put my dependeny (in the root composer.json file)

like image 116
Senči Avatar answered Sep 23 '22 17:09

Senči