Posted in Script

PHP5 轉 PHP7 的建議工具

PHP5 轉 PHP7 的建議工具 Posted on 2017 年 10 月 29 日Leave a comment

What is PHP 7 Migration Assistant Report(MAR)?

PHP 7 MAR, or just “php7mar”, is a command line utility to generate reports on existing PHP 5 code to assist developers in porting their code quickly to PHP 7. It will run against invididual files or entire project folders. Reports contain line numbers, issues noted, and suggested fixes along with documentation links.

git clone https://github.com/Alexia/php7mar.git
php mar.php -f="檔案"
php mar.php -f="目錄"

結果

Report located at: /root/php7mar/reports/2017-10-29 13.31.40 target.md

2017-10-29T13:31:09+00:00
Scanning /var/www/html/target
Including file extensions: php
ERROR! Syntax checking was selected and a PHP binary lower than 7.0.0-dev was specified.
Processed 65924 lines contained in 267 files.
Processing took 1.627012014389 seconds.

# critical
#### /var/www/html/target/config/database.php
* deprecatedFunctions
* Line 36: `| There is an incompatibility in PHP with mysql_real_escape_string() which`

 

 

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *