gpt4 book ai didi

symfony - 我的composer.json 文件中的波形符 (~) 是什么意思?

转载 作者:行者123 更新时间:2023-12-03 04:42:36 25 4
gpt4 key购买 nike

我的composer.json 文件中有这一行:

"require": {
...
"friendsofsymfony/user-bundle": "~2.0@dev",
...
},

~2.0@dev 中的波形符 ~ 到底是什么意思?这是一个占位符,并且应该始终获取 1.2.02.2.03.2.0 等颠覆版本吗?没有意义(将通过 * 通配符完成)。

composer.json documentation没有告诉任何有关波浪号的信息。

我问这个问题是因为我刚刚读到 security issue in the Symfony blog他们建议升级到1.3.3版本。但找出 FOSUserBundle 的版本并不那么容易(我找不到包含该版本的文件)。

最佳答案

波浪号表示下一个重要版本。在你的情况下,它相当于 >= 2.0, < 3.0 .

完整解释位于Tilde Version Range docs page :

The ~ operator is best explained by example: ~1.2 is equivalent to >=1.2 <2.0.0, while ~1.2.3 is equivalent to >=1.2.3 <1.3.0.

Another way of looking at it is that using ~ specifies a minimum version, but allows the last digit specified to go up.

Seldeak 的以下评论是对 Composer 文档的简单总结说明。

关于symfony - 我的composer.json 文件中的波形符 (~) 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18979729/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com