Upgrade symfony 2.8 or php 5.4 first?

可紊 提交于 2020-01-24 15:05:07

问题


I'll be working soon on a project and I just wanted to ask this before. The project is on symfony 2.8 with php 5.4. The goal is to upgrade symfony to 3.4 (maybe 4.x later) and php to 7.x (probably 7.2). So here is my question : is there a better order to do this? Php 5.4 to 7.2 first or symfony 2.8 to 3.4 (or it doesn't matter)? Thanks for your advices.


回答1:


First of all – you won't be able to run Symfony 3.4 project on PHP5.4.

As of 2018-11-26

The latest Symfony ^3.4 version is v3.4.19 which requires php: ^5.5.9|>=7.0.8.

On the other hand latest Symfony ^2.8 version is v2.8.48 which requires php: >=5.3.9.

Conclusion

You won't be able to run Symfony 3.4 project on PHP 5.4, but in theory you will be able to run Symfony 2.8 project with PHP 7.2.

You should also consider taking a look at: http://php.net/manual/en/migration70.incompatible.php




回答2:


I'd go with PHP first as long as Symfony allows you to. It's much easier to follow changes in PHP code then changes in big PHP framework.

The best way is to use an instant upgrade with Rector (a tool I wrote):

vendor/bin/rector process src --level php53
vendor/bin/rector process src --level php54
vendor/bin/rector process src --level symfony30
vendor/bin/rector process src --level php55
vendor/bin/rector process src --level symfony31
vendor/bin/rector process src --level php56
vendor/bin/rector process src --level symfony32
vendor/bin/rector process src --level php70
vendor/bin/rector process src --level php71
vendor/bin/rector process src --level symfony33
vendor/bin/rector process src --level symfony34

Always one minore version at a time.


I summed my experience with many upgraded websites in this post: How to Upgrade Symfony 2.8 to 3.4



来源:https://stackoverflow.com/questions/53634832/upgrade-symfony-2-8-or-php-5-4-first

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!