Prepare for PHP migration with Exakat

Exakat detects compatibility issues in your code, for each minor PHP versions since PHP 5.3. It scans the source for function apparence or disappearance, new syntax and behaviors.

init-project-done

With a local docker system and access to your code, you can use the following command line to execute Exakat. :

docker run -it --rm -v $(pwd)/projects:/usr/src/exakat/projects exakat/exakat:2.3.0 exakat init -p sculpin -R git@github.com:sculpin/sculpin.git

This creates a folder called ‘projects’ in your local directory, and initialize the project called ‘sculpin’ in it. In particular, it clones the code, from the github repository.

Then, run the audit itself :

docker run -it --rm -v $(pwd)/projects:/usr/src/exakat/projects exakat/exakat:2.3.0 exakat project -p sculpin

By default, it will run the classic ‘Diplomat’ report on the code. You can learn about it in the docs. Once this is done, the results is available in the projects/sculpin/diplomat report.

Audit configuration

Now is a good time to audit different sources :

  • -p : the name of the project. Arbitrary name, that you will remember later.
  • -R : the locator for the source.
  • --format : format of the report, in a machine readable format. For example, Perfile
  • -T : the name of the Rulesets rulesets you want to produce. For example, CompatibilityPHP80

docker run -it --rm -v $(pwd)/projects:/usr/src/exakat/projects exakat/exakat:2.3.0 exakat project -p sculpin -v

After running the ‘project’ commands, it is possible to access the individual reports without running again the audit.

After running the ‘project’ commands, it is possible to access the individual reports without running again the audit.

Some results are produced directly to the standard output :

  • PHP 8.0 compatibilitydocker run -it --rm -v $(pwd)/projects:/usr/src/exakat/projects exakat/exakat:2.3.0 exakat report -p sculpin --format Perfile -T CompatibilityPHP80
  • PHP 8.0 securitydocker run -it --rm -v $(pwd)/projects:/usr/src/exakat/projects exakat/exakat:2.3.0 exakat report -p sculpin --format Perfile -T Security

Some results are writen on the disk, in the projects/sculpin/ directory, in a specific file.

  • PHP compilation directivesdocker run -it --rm -v $(pwd)/projects:/usr/src/exakat/projects exakat/exakat:2.3.0 exakat report -p sculpin --format Phpcompilation

More details in the documentation.