oro/upgrade-toolkit

The Oro Source Code Upgrade Toolkit

dev-master 2024-12-06 14:52 UTC

This package is auto-updated.

Last update: 2024-12-06 21:18:05 UTC


README

A command line tool that simplifies upgrading Oro application source code from versions 4.0, 4.1, 4.2, 5.0, and 5.1 to version 6.0.

Installation

composer require oro/upgrade-toolkit:dev-master --dev

Suggested Workflow

  1. Analyze your code with and review suggested changes:
php bin/upgrade-toolkit --dry-run
  1. Apply suggested changes:
php bin/upgrade-toolkit --clear-cache
  1. Fix Code Style. Use IDE build-in solutions (e.g., “Code > Reformat Code” in PhpStorm), or run Php-CS-Fixer and PHP_CodeSniffer
# Run Php-CS-Fixer 
php bin/php-cs-fixer fix src --verbose --config=vendor/oro/platform/build/.php-cs-fixer.php

# Run PHP_CodeSniffer
php bin/phpcbf src/ -p --encoding=utf-8 --extensions=php --standard=vendor/oro/platform/build/Oro/phpcs.xml
  1. Run required automated tests to ensure that the upgraded code still works properly.

Usage

Run:

php bin/upgrade-toolkit

In most cases, the command can be used without any options.

If additional adjustments are needed, run the command with the --help option.

php bin/upgrade-toolkit --help

You can run rector rule sets separately by executing the following command:

bin/rector process src --config vendor/oro/upgrade-toolkit/sets/oro-51.php

If your source directory is not src/, replace src with the path to it and update oro-51.php with the desired upgrade set (either oro-51.php or oro-60.php).

To verify the results without making any changes, add the --dry-run option to the bin/rector command.

You can also process the .yml files to run separately:

php bin/upgrade-toolkit yml:fix

In this case, the recommended workflow is as follows:

  1. Check and verify results without making any changes first:
   php bin/upgrade-toolkit yml:fix --dry-run
  1. Apply changes:
   php bin/upgrade-toolkit yml:fix

Testing

To run tests, use the following command:

php bin/phpunit --testsuite upgrade-toolkit --configuration vendor/oro/upgrade-toolkit/phpunit.xml.dist

License

This bundle is under the MIT license. See the complete license in the bundle.