Can#39;t get composer quot;pathquot; repository to work(无法获得作曲家“路径存储库工作)
问题描述
我有一个这样的目录结构:
I have a directory structure like so:
composer.json < Main
packages/
balunker/
testpackage/
composer.json < Package
src/
TestPackage.php
主要的composer.json
如下所示:
{
"name": "vagrant/composer-test",
"repositories": [
{
"type": "path",
"url": "packages/*/*"
}
],
"require": {
"balunker/testpackage": "*"
}
}
虽然包 composer.json
看起来像这样:
While the package composer.json
looks like so:
{
"name": "balunker/testpackage",
"autoload": {
"psr-4": {
"Balunker\": "src/"
}
}
}
在 composer update
上,我简单地收到一条消息,指出无法解析包.没有创建符号链接,也没有安装包.我确实花了半天时间来解决这个问题,但没有任何成功.
On composer update
I simple get a message that the package could not be resolved. No symlinks are created and no package is installed. I have literally spent half of my day figuring this out, without any success.
我还上传了 composer update -vvv
的详细输出:http://pastebin.com/mMRHsACk.
I also uploaded a composer update -vvv
verbose output of this: http://pastebin.com/mMRHsACk.
我的作曲家版本是最新的(截至 2016 年 4 月 20 日下午 2:39 UTC),所有这些都在 Vagrant (Debian) 中运行.
My composer version is the latest (as of 20th of April 2016 at 2:39pm UTC) and all of this is running inside Vagrant (Debian).
非常感谢您提供的任何建议.我真的不知道还能做什么.
ANY recommendation from hereon is greatly appreciated. I really don't know what else to do any more.
推荐答案
我也在 Github 上发布了这个问题,结果发现文档有点误导.它说:
I posted the issue on Github as well and it turns out that the documentation is a little misleading. It says:
{
"repositories": [
{
"type": "path",
"url": "../../packages/my-package"
}
],
"require": {
"my/package": "*"
}
}
但是,如果您只有一个没有发布的本地 repo,您必须使用:
However, if you just have a local repo without releases, you have to use:
{
"repositories": [
{
"type": "path",
"url": "../../packages/my-package"
}
],
"require": {
"my/package": "dev-master"
}
}
版本 dev-master
是这里的关键(假设您在 master 分支上工作).这有点令人恼火,但感谢一些乐于助人的作曲家贡献者,我终于可以掌握这一点.
The version dev-master
is the key here (given that you are working on the master branch). This was mildly infuriating, but thanks to some helpful composer contributors, I could finally get a grip on this.
我希望这对将来的人有所帮助.
I hope this may help somebody in the future.
祝你好运!
这篇关于无法获得作曲家“路径"存储库工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:无法获得作曲家“路径"存储库工作
基础教程推荐
- 超薄框架REST服务两次获得输出 2022-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- 在多维数组中查找最大值 2021-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01