dereuromark / upgrade-cakephp
Command line tool for updating CakePHP applications and plugins.
Installs: 171
Dependents: 0
Suggesters: 0
Security: 0
Stars: 24
Watchers: 5
Forks: 60
Open Issues: 1
Requires
- php: ^8.1
- ext-json: *
- cakephp/cakephp: 5.x-dev as 5.1.1
- sebastian/diff: ^5.0.3
Requires (Dev)
- fig-r/psr2r-sniffer: dev-master
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.5
This package is auto-updated.
Last update: 2024-10-15 22:27:44 UTC
README
Upgrade tool as standalone application for CakePHP meant to facilitate migrating
from CakePHP 2.x to 3.x.[EOL]supports the minor upgrades in 3.x - up until currently 3.8+.[EOL]supports basic stuff for 4.x[See cake4 branch]- supports basic stuff for 5.x + extension development possible
Warning This tool is still under development and doesn't handle all aspects of migrating.
CakePHP 5
The brand new upgrade command of this tool provides a configurable approach. Define sets/levels and run it over your app or plugin:
bin/cake upgrade files /path/to/repo -v -d
Keep verbose and dry-run for checking if it works as expected, then apply your changes for real.
This tool works best in combination with the official upgrade tool and its rector based approaches.
- dereuromark/upgrade handles basic cases and non-PHP files
- cakephp/upgrade handles PHP class files via rector (requires valid PHP files)
If rector fails or cannot handle your app, you can try to use this tool completely by defining more regex based rules for example.
You can check active vs available tasks using --help
together with -v
.
It will list all available ones, active ones are in green.
For docs on this check here.
Installation
This plugin is standalone. Do not try to mix this with your existing app. Instead, put it somewhere completely separate from it. Best to clone it (git clone ....).
After downloading/cloning the upgrade tool, you need to install dependencies with composer
composer install
Once dependencies are installed you can start using the upgrade
shell.
Note: If you want to get the latest master, you can run composer update
at your own risk.
It will download also all recent changes done.
Alternatively, you can lock it down to a stable version and then update.
IMPORTANT NOTICE
This tool is an add-on to original CakePHP upgrade tool and provides additional fixers:
- Skeleton
The FileUpgrade tool also:
- see
src/Task/?
(tons of custom fixes)
Feel free to manually port those things back into the core one.
Usage
Upgrade command
Important upgrade steps:
- Skeleton upgrade (all skeleton files)
bin/cake upgrade /home/mark/Sites/my-app
Upgrade files
See above bin/cake upgrade files
docs.
Upgrade legacy shell
See cake4 branch.