我的 composer.json 文件中有这一行:
I have this line in my composer.json file:
"require": {
...
"friendsofsymfony/user-bundle": "~2.0@dev",
...
},
~2.0@dev
中的波形符 ~
到底是什么意思?那是一个占位符并且应该总是获取像 1.2.0
、2.2.0
、3.2.0
等这样的颠覆吗?没有意义(将由 *
通配符完成).
What does the tilde ~
in ~2.0@dev
exactly mean? Is that a placeholder and shall always fetch the subversions like 1.2.0
, 2.2.0
, 3.2.0
and so on? Doesn't make sense (and would be done by the *
wildcard).
composer.json 文档没有说明任何关于波浪号的信息.
The composer.json documentation doesn't tell anything about the tilde.
我之所以问,是因为我刚刚读到 Symfony 博客中的安全问题,他们建议升级到1.3.3 版.但是弄清楚 FOSUserBundle 的版本并不容易(我找不到包含该版本的文件).
I am asking because I just read about a security issue in the Symfony blog and they recommend to upgrade to version 1.3.3. But figuring out the FOSUserBundle's version isn't that easy (I couldn't find a file that contains the version).
波浪号表示下一个重要版本.在您的情况下,它相当于 >= 2.0, <3.0
.
Tilde means next significant release. In your case, it is equivalent to >= 2.0, < 3.0
.
完整的解释在 波浪号版本范围文档页面:
~
操作符最好用例子来解释:~1.2
等价于 >=1.2
上一篇:System.TypeLoadException引用.NET 1.0组件后,.NET 4.0迁移组件、TypeLoadException、System、NET
下一篇:composer prefer-dist 和 prefer-source 之间的区别?区别、prefer、composer、source