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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With