|
3 | 3 | [](https://github.com/cakephp/upgrade/actions/workflows/ci.yml) |
4 | 4 |
|
5 | 5 | Upgrade tools for CakePHP meant to facilitate migrating between CakePHP 4.x |
6 | | -versions and from CakePHP 4.x to CakePHP 5.x. This repository should be used as a standalone |
7 | | -application and *not* as a plugin. |
| 6 | +versions, from CakePHP 4.x to CakePHP 5.x, and between CakePHP 5.x versions. |
| 7 | +This repository should be used as a standalone application and *not* as a plugin. |
| 8 | + |
| 9 | +## Table of Contents |
| 10 | + |
| 11 | +- [Installation](#installation) |
| 12 | +- [Usage](#usage) |
| 13 | +- [Upgrading between CakePHP 4.x versions](#upgrading-between-cakephp-4x-versions) |
| 14 | +- [Upgrading from CakePHP 4.x to CakePHP 5.0](#upgrading-from-cakephp-4x-to-cakephp-50) |
| 15 | +- [Upgrading between CakePHP 5.x versions](#upgrading-between-cakephp-5x-versions) |
| 16 | +- [Additional Rulesets](#additional-rulesets) |
| 17 | +- [Upgrading from CakePHP 3.x to CakePHP 4.x](#upgrading-from-cakephp-3x-to-cakephp-4x) |
| 18 | +- [Development](#development) |
8 | 19 |
|
9 | 20 | ## Installation |
10 | 21 |
|
@@ -43,10 +54,66 @@ bin/cake upgrade rector --rules cakephp44 /path/to/your/app/src |
43 | 54 |
|
44 | 55 | There are rules included for: |
45 | 56 |
|
| 57 | +- cakephp40 |
46 | 58 | - cakephp41 |
47 | 59 | - cakephp42 |
48 | 60 | - cakephp43 |
49 | 61 | - cakephp44 |
| 62 | +- cakephp45 |
| 63 | + |
| 64 | +## Upgrading from CakePHP 4.x to CakePHP 5.0 |
| 65 | + |
| 66 | +When upgrading from CakePHP 4.x to CakePHP 5.0, use the `cakephp50` ruleset to |
| 67 | +automate many of the required changes: |
| 68 | + |
| 69 | +```bash |
| 70 | +cd /path/to/upgrade |
| 71 | + |
| 72 | +# Apply upgrade rules from 4.x to 5.0 |
| 73 | +bin/cake upgrade rector --rules cakephp50 /path/to/your/app/src |
| 74 | +bin/cake upgrade rector --rules cakephp50 /path/to/your/app/tests |
| 75 | +bin/cake upgrade rector --rules cakephp50 /path/to/your/app/config |
| 76 | +``` |
| 77 | + |
| 78 | +## Upgrading between CakePHP 5.x versions |
| 79 | + |
| 80 | +When upgrading between CakePHP 5.x versions, use the appropriate ruleset for |
| 81 | +the target version: |
| 82 | + |
| 83 | +```bash |
| 84 | +cd /path/to/upgrade |
| 85 | + |
| 86 | +# To apply upgrade rules from 5.2 to 5.3 |
| 87 | +bin/cake upgrade rector --rules cakephp53 /path/to/your/app/src |
| 88 | +``` |
| 89 | + |
| 90 | +There are rules included for: |
| 91 | + |
| 92 | +- cakephp50 |
| 93 | +- cakephp51 |
| 94 | +- cakephp52 |
| 95 | +- cakephp53 |
| 96 | + |
| 97 | +## Additional Rulesets |
| 98 | + |
| 99 | +The upgrade tool also includes rulesets for related tools and libraries: |
| 100 | + |
| 101 | +- **chronos3** - Upgrade to Chronos 3.x |
| 102 | +- **migrations45** - Upgrade to Migrations 4.5 |
| 103 | +- **phpunit80** - Upgrade to PHPUnit 8.0 |
| 104 | + |
| 105 | +```bash |
| 106 | +cd /path/to/upgrade |
| 107 | + |
| 108 | +# Apply Chronos 3 upgrade rules |
| 109 | +bin/cake upgrade rector --rules chronos3 /path/to/your/app/src |
| 110 | + |
| 111 | +# Apply Migrations 4.5 upgrade rules |
| 112 | +bin/cake upgrade rector --rules migrations45 /path/to/your/app/config |
| 113 | + |
| 114 | +# Apply PHPUnit 8.0 upgrade rules |
| 115 | +bin/cake upgrade rector --rules phpunit80 /path/to/your/app/tests |
| 116 | +``` |
50 | 117 |
|
51 | 118 | ## Upgrading from CakePHP 3.x to CakePHP 4.x |
52 | 119 |
|
|
0 commit comments