dereuromark / cakephp-shim
A CakePHP plugin to shim applications between major framework versions.
Installs: 780 406
Dependents: 7
Suggesters: 0
Security: 0
Stars: 37
Watchers: 4
Forks: 11
Open Issues: 0
Type:cakephp-plugin
Requires
- php: >=8.1
- cakephp/cakephp: ^5.0.7
Requires (Dev)
- dereuromark/cakephp-ide-helper: ^2.0.0
- fig-r/psr2r-sniffer: dev-master
- phpunit/phpunit: ^10.1
- dev-master
- 3.3.0
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.1
- 3.1.0
- 3.0.1
- 3.0.0
- 3.0.0-RC
- 2.4.1
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.1
- 2.0.0
- 2.0.0-beta
- 1.10.2
- 1.10.1
- 1.10.0
- 1.9.0
- 1.8.3
- 1.8.2
- 1.8.1
- 1.8.0
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.1
- 1.6.0
- 1.5.0
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.7.6
- 0.7.5
- 0.7.4
- 0.7.2
- 0.7.1
- 0.7.0
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.5
- 0.5.4
- 0.5.3
- 0.5.2
- 0.5.1
- 0.5.0
- 0.4.0
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.2
- 0.1.1
- 0.1.0
- dev-cake4
- dev-cake2
- dev-table-aware
- dev-cake3
This package is auto-updated.
Last update: 2024-11-16 19:07:44 UTC
README
Shim plugin to "shim" functionality up and down for CakePHP major versions. It also provides some small app-specific fixes.
This branch is for shimming 4.x in 5.x
It provides compatibility wrapper access to 4.x functionality in 5.x.
This is mainly useful when upgrading large applications to the next major framework version. Tons of code needs to be adjusted, using this Shim plugin quite a few lines less need to be touched. Especially the ORM layer, which would need heavy refactoring, requires a lot less changes to get things working again.
This branch is for use with CakePHP 5.0+. For details see version map.
Installation
Please see Install.md
Usage
Please see Docs.
A full overview of all shimming between versions can be found in the Wiki.
New shims
- RequestHandler component for continued easier View class switching across the app
- LegacyModelAwareTrait for loadModel() shimming
- former Cake\Filesystem\File and Cake\Filesystem\Folder classes
- ModifiedTrait for entities and detecting actually changed fields (not just touched with same value)
Note: AuthComponent lives on in 5.x via TinyAuth plugin if needed.
Existing shims from 4.x
- Controller setup for components and helpers
- Nullable behavior for better data consistency.
Table::field()
support andfieldByConditions()
alias to migrate to.- Still supports model properties
$primaryKey
,$displayField
,$order
,$validate
,$actsAs
and all relations ($belongsTo
,$hasMany
, ...) as it would be very time-consuming to manually adjust all those. - Auto-adds Timestamp behavior if
created
ormodified
field exists in table.
Helpful links
When planning to upgrade, you should look into official upgrade docs as well as the linked upgrade tool. They both contain tons of more ideas on how to get code aligned with the current direction of the framework to reduce friction in the long run. Also see my blog post dereuromark.de/2023/09/28/cakephp-5-upgrade-guide/.