无法获得作曲家的“路径"工作库 [英] Can't get composer "path" repository to work

查看:100
本文介绍了无法获得作曲家的“路径"工作库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的目录结构如下:

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看起来像这样:

{
  "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.

我的作曲者版本是最新版本(截至UTC,2016年4月20日下午2:39),所有这些都在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": "*"
    }
}

但是,如果您只有本地发行版而没有发行版,则必须使用:

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.

祝你好运!

这篇关于无法获得作曲家的“路径"工作库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆