简体   繁体   English

检查旧的php脚本以升级/迁移到较新的php版本

[英]check old php scripts for upgradeing/migrating to newer php version

I've many PHP-Scripts based on older PHP Versions. 我有许多基于旧PHP版本的PHP脚本。 I'm currently using PHP 5.3 and want to upgrade to a newer Version, but I don't know which is compatible with the functions I'm using. 我当前正在使用PHP 5.3,并且想要升级到较新的版本,但是我不知道哪个与我正在使用的功能兼容。 Is there a Framework or any other tool to check the Scripts with? 是否有框架或其他工具可用于检查脚本? I want to upgrade/migrate to PHP 7.2 and I know that some functions (like mysql) are removed. 我想升级/迁移到PHP 7.2,我知道某些功能(如mysql)已删除。 I don't remember every function I used in those hundreds of Scripts and don't really want to search line for line for deprecated and removed functions. 我不记得我在那数百个脚本中使用过的每个函数,也不是真的不想在行中搜索已过时和删除的函数。

You can have a look at Phan . 您可以看看Phan It runs under PHP and can statically analyze your scripts for compatibility with newer PHP versions. 它在PHP下运行,并且可以静态分析您的脚本以与新的PHP版本兼容。

If you call it using 如果您使用

phan --directory <directory_with_scripts> --target-php-version 7.2

It'll tell you what will fly and what will not! 它会告诉您什么会飞,什么不会飞!

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM