Answer the question
In order to leave comments, you need to log in
How to connect private repositories to dependencies in Composer?
We use Composer to include shared libs in projects. The libs themselves lie as separate private repositories in GitLab.
Usually connected like this:
{
"require": {
"yiisoft/yii": "1.1.15",
"thc/hotels-catalog-rest-client": "dev-master"
},
"config": {
"vendor-dir": "protected/vendor"
},
"repositories": [
{
"type": "git",
"url": "http://gitlab.thcdev.ru/thc/hotels-catalog-rest-client.git"
}
]
}
{
"name": "thc/hotels-catalog-rest-client",
"description": "Hotels Catalog Api Client",
"classmap": ["/"],
"require": {
"thc/yii1-rest-client": "dev-master"
},
"repositories":[
{
"type":"git",
"url":"http://gitlab.thcdev.ru/thc/yii1-rest-client.git"
}
]
}
Problem 1
- thc/hotels-catalog-rest-client dev-master requires thc/yii1-rest-client dev-master -> no matching package found.
- thc/hotels-catalog-rest-client dev-master requires thc/yii1-rest-client dev-master -> no matching package found.
- Installation request for thc/hotels-catalog-rest-client dev-master -> satisfiable by thc/hotels-catalog-rest-client[dev-master].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see for more details.
Read for further common problems.
{
"require": {
"yiisoft/yii": "1.1.15",
"thc/hotels-catalog-rest-client": "dev-master"
},
"config": {
"vendor-dir": "protected/vendor"
},
"repositories": [
{
"type": "git",
"url": "http://gitlab.thcdev.ru/thc/hotels-catalog-rest-client.git"
},
{
"type": "git",
"url":"http://gitlab.thcdev.ru/thc/yii1-rest-client.git"
}
]
}
{
"require": {
"yiisoft/yii": "1.1.15",
"thc/hotels-catalog-rest-client": "dev-master",
"thc/yii1-rest-client": "dev-master"
},
"config": {
"vendor-dir": "protected/vendor"
},
"repositories": [
{
"type": "git",
"url": "http://gitlab.thcdev.ru/thc/hotels-catalog-rest-client.git"
},
{
"type": "git",
"url":"http://gitlab.thcdev.ru/thc/yii1-rest-client.git"
}
]
}
Answer the question
In order to leave comments, you need to log in
https://toranproxy.com/ try this. Easy to install, eliminates the above problems. Can fully proxy all packages or be used only for private repositories. It has a web interface for adding new private repositories, which is very convenient.
https://getcomposer.org/doc/04-schema.md#repositories
I found in the documentation that the repositories section is root-only, i.e. all sections of repositories defined in all dependencies are ignored.
I followed the right path, but it's still not clear why writing my repository in the root composer.json did not work.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question