1
头图
Cover image from: pexels.com

foreword

Recently, with the release of Laravel 9, someone found an interesting thing, that is, Laravel 9 was originally developed as an LTS version to replace Laravel 6. It was also released as an LTS version when it was officially released, and after the official release. Soon, Laravel 9's LTS wording was removed from Laravel's official documentation, making Laravel 9 a "normal version".

For normal version , Laravel provides 18 months of bugfixes and 2 years of security updates. And for long-term support version provides 2 years of bugfixes and 3 years of security updates.

In the process of doing things, we are always afraid of problems. After doing something, we often say "if it can be used, don't change it easily". This sentence applies in the past and will be the same in the future. It is also applicable, this is the experience gained by the predecessors. As long as you don't do things, you can't go wrong

With the evolution of the times, the speed of software iteration is fast. Some software has a major version every two years, and some even have a major version every year, and its support cycle is generally only two or three years. If your business can survive Go on, maybe after two or three years, the version you are using is several major versions different from the latest version, and maybe the version you are using has been officially stopped being supported. At this time, if you do not upgrade the version you are using , you risk exposing your business to risk.

What is LTS and what are its advantages?

Long-term support (English: Long-term support, abbreviation: LTS) is a product life cycle policy for software, especially open source software, which increases the reliability of the software development process and software version cycle. Long Term Support extends the period of software maintenance; it also changes the type and frequency of software updates (patches) to reduce risk, expense, and disruption to software deployment, while increasing software reliability.

The above is an excerpt from Wikipedia's description of LTS. It can be seen that LTS seems to have an effective solution to the problems we discussed earlier, that is, when we set up the project, we directly chose the LTS version. Compared with the normal version, LTS reduces the update frequency and extends the support time. In this way, we can ensure that the framework or library used by our project has a long enough support (functional, security) time, thereby reducing security risks and maintenance costs.

Disadvantages of LTS

LTS support depends on the support of the software manufacturer, some may support 2 years, some may be 3 years, and some may be 5 years.

In addition, during this long support period, the normal version of the software may have added several versions and introduced many new features, and you may miss these new features.

This is not the most troublesome, troublesome things are still to come.

If you asked me in the past, "When you start a new project, will you choose the LTS version, or the latest version?" I will definitely "choose the LTS version" without hesitation, because no company can refuse "stable". Positive factors, after all, most of the time the company will be based on stability.

But if I put it now, I will tell you "I will choose the current newer stable version", when your business can be supported all the time, two years, three years, five years, or even longer. The gap between the main versions will become larger and larger, and the risk of one-time upgrade will become larger and larger, and you will be less afraid to upgrade easily, which may cause the version you use to stay there forever.

Take Laravel as an example, once you have the idea of the preferred LTS, if you chose Laravel 5.1 LTS when you created the project in 2015, then two years later, in 2017, the Laravel LTS version ushered in the 5.5 version update. At this time, you are short of the spans of 5.2, 5.3, and 5.4 versions. Although the content of the upgrade guides for these three versions is not much, in addition to the framework itself, you also need to take into account some of the libraries that the framework depends on. You might even have to take care of your PHP version and so on.

Also, it's worth noting that each version of PHP is actively supported for only 2 years, plus 1 year of security updates.

At the same time, because of the possible risks of such a large span, your Leader may not agree to your upgrade, and it may be more troublesome later.

One thing I have to mention is that although Laravel provides the LTS version, most of the dependencies used by Laravel do not provide the LTS option, which also makes its LTS version lose a certain meaning.

Back to Laravel 9

The target PHP version of Laravel 9 is >=8.0.2 , which also includes 8.1, such as Eloquent's enum conversion

enum is a new syntax feature introduced in PHP 8.1, see PHP manual for an introduction to enum .

The day after Laravel 9 was released, Symfony , which Laravel depends on, brought up a discussion

It was proposed in the discussion that in the next version of Symfony, namely 6.1, the minimum PHP version requirement of Symfony should be raised to 8.1, and no minor version update of Symfony until then would raise the minimum PHP version requirement.

Currently, according to Laravel developer Taylor Otwell , Laravel 9 will also provide security updates for at least 2 years in the worst case (ie, normal version support).

According to the composer.json declaration of laravel/framework , in the next major version of Laravel, Laravel 10 will depend on some components of Symfony 6.1, which also means that the minimum PHP version requirement of Laravel 10 will be increased to 8.1 .

Epilogue

At the same time, Taylor Otwell also said on Twitter : " encourage everyone to always try to use the latest Laravel "

image-20220306132441238.png

The current Symfony discussion on that issue is now closed and it has been confirmed that Symfony 6.1 will increase the minimum PHP version limit to 8.1

In this regard, in the selection of PHP framework and PHP version, I still think: In order to avoid the problems caused by the larger version span in the later stage, we should use and update to the newer version in time instead of escaping to use the LTS version, thus causing some "historical problems" in the future

  • Articles are for personal turn off representations only.
  • If you have good suggestions and opinions, please discuss with each other
  • If the content of the article infringes your rights, please contact me to deal with it.
  • You can also click on the source link in the article and the reference link at the bottom of the article for more details.

refer to


唯一丶
23.1k 声望8.6k 粉丝

友情链接