【问题标题】:Composer SVN dependency errorComposer SVN依赖错误
【发布时间】:2016-01-06 06:49:21
【问题描述】:

我在 SVN 中有一些库类,我已经成功地使用了 Composer。但是今天我遇到了这个问题,Composer 认为它找不到匹配的包,即使它存在并且 Composer 在其他情况下可以找到它。

这里是有问题的 2 个包的 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/clxmsgclx/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/clxmsg 而满足 clx/ldap -- 上面的包它刚刚工作的地方

$ 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.

我做错了什么?还是在 SVN 中使用 VCS 源时 Composer 进行递归依赖解析时存在错误?

【问题讨论】:

    标签: svn composer-php


    【解决方案1】:

    我相信这与Composer doesn't find local vcs dependency 中描述的问题相同。我在搜索时无法找到引用的帖子,但是一旦我输入了我的问题描述,它就会很好地出现在右侧的“类似问题”列中。

    简短的回答是“Composer 不会对 VCS 包执行此操作。”引用的问题似乎使用 Git 而不是 SVN,但没有区别。

    对上述问题的回答以及提供的 Composer 常见问题解答 (https://getcomposer.org/doc/faqs/why-can%27t-composer-load-repositories-recursively.md) 链接中的解释说明了为什么它不能按预期工作。

    【讨论】:

      猜你喜欢
      • 2020-01-07
      • 1970-01-01
      • 2022-08-15
      • 2014-09-18
      • 2023-01-14
      • 2015-12-03
      • 1970-01-01
      • 1970-01-01
      • 2015-01-24
      相关资源
      最近更新 更多