pieceofcake2 / upgrade
Upgrade shell that converts CakePHP 1.3 applications to CakePHP 2
Requires
- php: >=8.0
- composer/installers: ^1.0 || ^2.0
- nikic/php-parser: ^5.0
- pieceofcake2/cakephp: ^2.12
- rector/rector: ^2.7
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^9.6
- pieceofcake2/app: ^2.2
- pieceofcake2/phpcs-cakephp2: ^1.1
- pieceofcake2/phpstan-cakephp2: ^1.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-24 06:46:15 UTC
README
The Upgrade plugin provides the upgrade console shell, which automates most of the
mechanical changes needed to upgrade a CakePHP 1.3 application to CakePHP 2 on
pieceofcake2/cakephp.
Documentation
- Website: https://pieceofcake2.github.io/upgrade/ (日本語: https://pieceofcake2.github.io/upgrade/ja/)
- Markdown: docs/README.md (日本語: docs/ja/README.md) (for AI tools and offline reading)
The Markdown documentation is also included in the Composer package, in the plugin's directory: plugins/Upgrade/docs/README.md (the location depends on your installer-paths). Install the package with --dev if you only need it for development.
Requirements
- PHP 8.0+
- pieceofcake2/cakephp 2.12+
- rector/rector 2.7+ (installed with the plugin), for the
rectorandnamespacecommands - pieceofcake2/cakephp 2.13+ for the code that
namespaceand thenamespaced-classesandclass-name-stringsrules write
Installation
composer require --dev pieceofcake2/upgrade
Then load the plugin with CakePlugin::load('Upgrade') and run bin/cake upgrade all
(legacy layout: app/Console/cake upgrade all). Back up your application first.
bin/cake upgrade rector runs the Rector rules of the plugin for a change of
pieceofcake2/cakephp, e.g. --rules variadic-arguments src tests, --rules namespaced-classes src tests or
--rules class-name-strings src tests config. See Rector Rules.
bin/cake upgrade layout moves an application (or a plugin, with --plugin) from the CakePHP 2 layout to the
CakePHP 5 layout of pieceofcake2/app (config/, src/, templates/, ...),
and bin/cake upgrade namespace then moves its classes into a namespace, with App.namespace and PSR-4. Run them in
this order, with --dry-run first. See Layout and Namespace.
Contributing
See the contribution guidelines.
Origin
This package is based on the upgrade console shell of
cakephp/cakephp (cakephp/cakephp on Packagist, last upstream
version 2.10.24), originally by the CakePHP community (Cake Software Foundation, Inc.). It was
extracted into a separate package and is maintained for CakePHP 2 on modern PHP by
pieceofcake2. Changes from the original are listed in the
commit history.
License
Licensed under the MIT License. See LICENSE.