我在SVN中有一些库类,我已经成功地使用了Composer。但今天我遇到了这个问题,Composer认为它找不到匹配的包,即使它在那里,而且Composer可以在其他情况下找到它。
以下是两个有问题的包的composer.json:
{
"name": "clx/auth",
"repositories": [ {
"type": "vcs",
"url": "https://svn.example.com/",
"package-path": "Ldap"
}
} ],
"require": { "clx/ldap": "dev-trunk" }
}
{
"name": "clx/ldap",
"repositories": [
{
"type": "vcs",
"url": "https://svn.example.com/",
"package-path": "ClxMsg"
},
{
"type": "vcs",
"url": "https://svn.example.com/",
"package-path": "ConfigIni"
}
],
"require": {
"clx/clxmsg": "dev-trunk",
"clx/configini": "dev-trunk"
}
}
当我在clx/ldap目录中运行install时,输出看起来像这样,一切都很好。请注意,确实找到clx/clxmsg
和clx/configini
而没有问题:
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing icecave/isolator (dev-develop fdf22e6)
Cloning fdf22e670e7d10b51335083817ca0e8597c41168
- Installing psr/log (dev-master 9e45edc)
Cloning 9e45edca52cc9c954680072c93e621f8b71fab26
- Installing cxj/phpsyslog (v1.1.3)
Loading from cache
- Installing clx/clxmsg (dev-trunk)
Checking out /trunk/ClxMsg/@24831
- Installing clx/configini (dev-trunk)
Checking out /trunk/ConfigIni/@24831
Writing lock file
Generating autoload files
然而,当我转到clx/auth包目录时,它在满足clx/ldap
的同时找不到clx/clxmsg
——它刚刚工作过的上面的包!
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for clx/ldap dev-trunk -> satisfiable by clx/ldap[dev-trunk].
- clx/ldap dev-trunk requires clx/clxmsg dev-trunk -> no matching package found.
我做错了什么?或者Composer在SVN中使用VCS源时进行递归依赖解析时是否存在错误?
我相信这与Composer';找不到本地vcs依赖项。我在搜索时找不到引用的帖子,但当我输入问题描述后,它很好地出现在右侧的"类似问题"栏中。
简短的回答是"Composer不使用VCS包。"引用的问题似乎使用Git而不是SVN,但这没有什么区别。
上面提到的问题的答案中的解释,以及提供的Composer常见问题解答链接中的解释(https://getcomposer.org/doc/faqs/why-can%27t-composer递归加载存储库.md)描述了为什么它不能按预期工作。