composer / composer

Dependency Manager for PHP
https://getcomposer.org/
MIT License
28.53k stars 4.53k forks source link

Recursive Dependencies #1125

Closed rufinus closed 12 years ago

rufinus commented 12 years ago

Hi,

I have a composer.json looking like this:

{
    "name": "zendframework/skeleton-application",
    "description": "Skeleton Application for ZF2",
    "license": "BSD-3-Clause",
    "keywords": [
        "framework",
        "zf2"
    ],
    "homepage": "http://framework.zend.com/",
    "repositories": [
        {
            "type": "composer",
            "url": "http://packages.******t"
        }
    ],
    "minimum-stability": "dev",
    "require": {
        "php": ">=5.3.3",
        "zendframework/zendframework": "2.0.*",
    "zendframework/zend-developer-tools" : "dev-master",
    "cwd/common" : "dev-master",
        "cwd/admin" : "dev-master",
        "ext-intl": "*",
        "doctrine/doctrine-module": "@dev",
        "doctrine/doctrine-orm-module": "@dev"
    },
    "require-dev": {

    }
}

cwd/comon has the following in his composer.json:

{
        "name" : "cwd/Common",
        "type" : "library",
        "description" : "ZF2 Libaries used by CWD Modules",
        "keywords" : ["php", "zf2", "zend framework2", "common"],
        "homepage" : "http://www.******t",
        "license" : "Commercial Other",
        "support" : {
                "email" : "support@****"
        },
        "authors": [
                {
                "name": "Ludwig",
                "email": "lr@***",
                "homepage": "http://www.*****/",
                "role": "Developer"
                }
        ],
        "repositories": [
            {
                "type" : "composer",
                "url" : "http://packages.cwd.at/"
            },{
                "type" : "pear",
                "url" : "pear.firephp.org",
                "vendor-alias" : "firephp"
            }
        ],
        "minimum-stability": "dev",
        "require": {
                "php": ">=5.3.0",
                "zendframework/zendframework": ">=2.0",
                "firephp/FirePHPCore" : "*"
        },
        "autoload" : {
            "psr-0" : {
                "cwdCommon" : "src/"
            },
        "classmap" : [
            "./Module.php"
        ]
    }
}

the firephp pear package is never loaded/installed if i move the repository and the required line up to the "main" composer.json its working as expected.

What do i wrong? Isn't composer supposed to resolve recursive dependencies?

TIA Rufinus

stof commented 12 years ago

It resolve recursive dependencies. However, repository definitions can only be provided by the root package, as documented here. The explanation about this choice is also in the doc

rufinus commented 12 years ago

thanks for the pointers, i somehow missed this page in the documentation.