Download the PHP package monque/php-migration without Composer
On this page you can find all versions of the php package monque/php-migration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download monque/php-migration
More information about monque/php-migration
Files in monque/php-migration
Package php-migration
Short Description A static analyzer for PHP version migration and compatibility
License MIT
Homepage http://github.com/monque/PHP-Migration
Informations about the package php-migration
PHP Migration
Readme in Chinese 中文
This is a static analyzer for PHP version migration and compatibility checking.
It can suppose your current code running under the new version of PHP then do checking, and provide advice and treatment.
And it can simplify the process of upgrading PHP. Its goal is instead of manual checking.
Features:
- Wide coverage, checks most of the changes which introduced in PHP 5.3 - 7.0.
- Strict, without missing any risk.
- Zero configuration, run directly after download.
- Simply add custom checks.
Compare to the similar project PHP Compatibility
PHP Compatibility
is a set of sniffs forPHP_CodeSniffer
, therefore it lacks flexibility and can not checks more changes. just objective comparison
Notice: this project is in beta stage, feel free to report any issues.
Install / Usage
-
You can download a executable Phar file
-
Use the following command to check PHP file
Suppose these code stored in
sample.php
-
Output report Each columns means: Line Number, Level, Identified, Version, Message
The third field
Identified
will be explained at bottom.
Set Selection
A Checking Set contains muiltiple Check Class, and the dependence of Set can be specified.
List all sets through command php phpmig.phar -l
.
And add param -s
like php phpmig.phar -s <setname>
to select a set to use.
Utility, print class tree
Like the common linux command tree
, the following command will scan files and
output all classes in a tree-like format.
Output:
Manual Installation from Source
-
Clone this project to your local path
-
Using Composer to install dependencies
- Verify it works
Explaination
Process Flow
About the third field Identified
in outputing
To be honest, not all code will be checked accurately as you expect.
Some changes will never be checked accurately, and it's has nothing to do with someone's ability or technology.
For example, unpack()
changes in PHP
5.5,
it now keeps trailing NULL bytes when the "a" format code is used.
Code below:
But we can guess the value of variables, and make a level table:
Level | Identified | Output |
---|---|---|
MUST affect | Yes | Yes |
MUST NOT affect | Yes | No |
MAY affect | No | Yes |
So, finally output
License
This project is released under the MIT license.