本文介绍了作曲家如何处理同一软件包的多个版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

可能(应该)在某个地方被问过,但是我似乎找不到答案。如果有人提供了链接,我可以删除该帖子!:

This may (should) have been asked before somewhere but I can't seem to find an answer. If someone provides a link I can delete this post!:

只是想让我了解一些作曲家的功能(可能也适用于其他软件包管理器)。

Just trying to get my head around some of composer's (probably applies to other package managers too) functionality.

基本上我只想知道在以下情况下作曲家的工作:

Basically I just want to know what composer does in the following scenarios:

1。

我的主项目有一个依赖项:

My main project has a dependency:

"guzzlehttp/guzzle": "5.0.*",

我的外部捆绑包对

"guzzlehttp/guzzle": "5.0.*",

作曲家是否安装guzzlehttp / guzzle一次是因为知道它只需要一次?

Does composer install guzzlehttp/guzzle one time because it knows it only needs it once?

2。
相同的情况,但将来如果有人更新要使用的主项目:

2.Same scenario but in the future if someone updates the main project to use:

"guzzlehttp/guzzle": "6.0.*",

作曲家现在将安装2个版本的guzzle(5和6)(我认为这是应该执行的操作),还是采用最高版本(即6)?另外,如果有两个版本,是否会因为名称空间相同而引起冲突?

Will composer now install 2 versions of guzzle (5 and 6) (I presume this is what it should do), or will it take the highest version (i.e. 6)? Also if there are 2 versions will this cause any conflicts because namespaces might be the same?

谢谢

推荐答案

问题1



是,Composer只能为每个扩展/软件包安装一个版本。

To question 1

Yes Composer can only install one version of each extension/package.

由于答案1:作曲家会认为您的主项目与外部软件包不兼容。

Because of answer 1: Composer would consider your main project and the external package as incompatible.

在这种情况下,您可以


  • 在主项目中使用版本5

  • 如果兼容的话,也请外部软件包所有者升级到版本6。

  • 分叉外部软件包并使其与版本兼容6个你自己

这篇关于作曲家如何处理同一软件包的多个版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 22:15