In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article is to share with you about the difference between the wavy symbol of Composer and the power symbol ^. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
I have seen too many people scribble their version numbers (in fact, it is much better now). The next version of 1.9.0 must be 2.0.0, and the next version of 2.9.0 must be 3.0.0. It is mainly because there is no standard for the naming of the version number before, and everyone writes according to the mood. Later, semantic versioning was promoted and the naming of the version number was improved, but there are still many people who do not know what the three-paragraph version number means. ).
To put it simply (I'm just moving it, the website mentioned above makes it clearer), the meaning of each paragraph of the three-paragraph version number is:
A large version. A small version. Patch version
Let's start with the most obvious patch version. If some bug has been fixed in your software or library, the patch version needs to be + 1.
Let's talk about the small version number. If you add new features, such as RPG games with automatic pick-up, or if you add a new method to your code base, and users upgrade your code base without causing compatibility problems (BC), then the small version number + 1.
Finally, if your software is completely refactored, or if your code base is completely refactored so that users upgrade the new library will inevitably lead to compatibility problems, then the large version number + 1.
Of course, there will also be cases where bug is modified and functionality is added at the same time. In short, if the previous bit needs + 1, the subsequent digits must be cleared no matter what.
In fact, there is no need to be too strict with end-user-oriented software, because end-users don't care much about versions (except for major version numbers. So there is a chrome-style version number, and Firefox goes along with it. ), but for the author of the library file, it is better to abide by the version number, because the version number you set provides very important information to the library caller, who needs to use your version number to determine whether to avoid compatibility issues.
To take a more classic example, although Symfony is similar in use in 2-3-4, the major version number must be + 1 because of the inconsistency of interfaces between the three versions. If there is an interface change in your library file that makes it incompatible with the previous version, even if there is only one, you should use the large version number + 1.
And if you develop some projects with Symfony 3.0.x, even if you upgrade directly to 3.4.x, there will be no problem in theory.
After talking about the three-paragraph version number, let's talk about a problem that bothers PHPer. What exactly does the ^ symbol and ~ symbol of the specified version number in composer.json mean? What's the difference?
Before writing this blog, I actually searched Baidu to find out whether there are many related articles and whether this article is worth writing or not. Search results show that it has indeed been summed up. Although most of them have only one example:
~ 1.2.3 represents 1.2.3
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.