Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer - No Matching Package Found

I have a PHP framework I've built, and I'm trying to separate everything into different repos and get it set up in composer to make my life easier.

Basically, I have 3 repos in question: one is for a collection class that serves as a base class for collection data types ("liftkit/collection"), another is a wrapper for input variables ("liftkit/input", which depends on the collection repo), and a third that is for the core ("liftkit/core", which depends on the input wrapper.

When I run composer update on "liftkit/input", it installs "liftkit/collection" and works fine, but when I run it on "liftkit/core" it gives me the following error:

Problem 1 - Installation request for liftkit/input @dev -> satisfiable by liftkit/input[dev-master]. - liftkit/input dev-master requires liftkit/collection dev-master -> no matching package found.

Here are my composer.json files:

{
    "name": "liftkit/collection",
    "description": "LiftKit base class for collections",
    "license": "LGP-2.1",
    "autoload": {
        "psr-4": {
            "LiftKit\\": "src/"
        }
    },
    "require": {
    },
    "require-dev": {
        "phpunit/phpunit": "4.5.*"
    }
}

{
    "name": "liftkit/input",
    "description": "LiftKit input wrappers",
    "license": "LGP-2.1",
    "autoload": {
        "psr-4": {
            "LiftKit\\": "src/"
        }
    },
    "require": {
        "liftkit/collection": "dev-master"
    },
    "require-dev": {
        "phpunit/phpunit": "4.5.*"
    },
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/liftkit/collection"
        }
    ]
}

{
    "name": "liftkit/core",
    "description": "LiftKit Core Libraries",
    "license": "LGP-2.1",
    "minimum-stability": "dev",
    "autoload": {
        "psr-4": {
            "LiftKit\\": "src/"
        }
    },
    "require": {
        "liftkit/input": "dev-master",
        "liftkit/dependency-injection": "dev-master"
    },
    "require-dev": {
        "phpunit/phpunit": "4.5.*"
    },
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/liftkit/input"
        },
        {
            "type": "git",
            "url": "https://github.com/liftkit/dependency-injection"
        }
    ]
}

Any help is greatly appreciated. Thanks.

like image 304
Ryan Williams Avatar asked Feb 17 '15 17:02

Ryan Williams


1 Answers

Looks like composer won't resolve repositories recursively. From the docs:

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

So I guess I'm out of luck. I'll have to specify the repositories in each repo.

like image 200
Ryan Williams Avatar answered Oct 05 '22 12:10

Ryan Williams