Composer VCS存储库未加载依赖关系
我正在通过composer包含一个私有git存储库,并且可以按预期从bitbucket加载它,但是我将代码接收定义为私有包中的公共依赖项。
I'm including a private git repository via composer, and it's loading as expected from bitbucket, however I have codeception defined as a public dependency in my private package.
已加载我的私有软件包,但未添加任何依赖项。我已经阅读到,使用存储库时composer不支持递归依赖项加载: https://getcomposer.org/doc/faqs/why-can%27t-composer-load-repositories-recursively.md
My private package is loaded, but none of it's dependencies are added. I have read that composer does not support recursive loading of dependancies when using repositories: https://getcomposer.org/doc/faqs/why-can%27t-composer-load-repositories-recursively.md
但是我对此的理解是,我的私有存储库无法定义另一个私有存储库,但仍应能够使用在packagist.org上定义的公共存储库。
However my understanding of this is that my private repository can't define another private repository, but should still be able to make use of public repositories defined on packagist.org
私有存储库composer.json:
Private repositories composer.json:
{
"name": "private/dependancy",
"description": "Private git dependency",
"type" : "library",
"require-dev": {
"codeception/codeception": "*"
}
}
项目的composer.json(下至相关部分)
Project's composer.json (Trimmed down to relevant sections)
{
"name": "primary/project",
"description": "Main project including a vcs dependancy",
"require": {
"private/dependancy" : "0.0.*"
},
"repositories":[
{
"type" : "vcs",
"url" : "some repo",
"options": {
"ssh2": "some crednetials"
}
}
]
}
对此的任何指导
Composer不会安装您需要的软件包的dev-dependencies。
Composer will not install dev-dependencies of the packages you require yourself.
您的主要/项目需要私有/依赖,而无需其他。没有列出任何列为require-dev的东西,因为在开发私有/依赖关系时会使用该东西,而不是在使用它时使用。
Your primary/project requires private/dependency, which does not require anything else. Anything listed as require-dev is not installed, because that is considered to be used when developing private/dependency, not when using it.
另一件事只有在在主composer.json上运行Composer且未明确排除dev依赖项是 autoload-dev。
Another thing that only get's evaluated when running Composer on the primary composer.json and not explicitly excluding dev dependencies is "autoload-dev".
composer install --no-dev
将不会安装任何dev依赖项,也不会为dev创建自动加载。
will not install ANY dev dependencies and not create autoloading for dev.
composer install
将安装主要项目的dev依赖关系,并为dev创建自动加载-它绝不会安装通过require或require-dev添加的任何软件包的dev依赖关系,而不添加其autoload-dev。
will install dev dependencies of the primary project, and create autoloading for dev - it will never install dev dependencies of any of the packages added via require or require-dev, and not add their autoload-dev.