GitXplorerGitXplorer
d

cakephp-shim

public
37 stars
11 forks
0 issues

Commits

List of commits on branch master.
Verified
9756f98e7e607418b2d97bc19b4704a809b76cb5

Update README.md

ddereuromark committed 2 months ago
Verified
04aa7bac781475c94a023ee9f47e4bac3005d56c

CI PHP versions

ddereuromark committed 2 months ago
Verified
15adc2bd69e1df5069e76f421ca4374cc3d1b459

Sync CI script

ddereuromark committed 2 months ago
Verified
633cfe4a64d8c0fc661d07f9b9b67c71f4e2e3e9

Sync CI script

ddereuromark committed 2 months ago
Verified
b144d9802ec1842e162d8fbcec6964dda431e84b

Test PHP8.4

ddereuromark committed 3 months ago
Verified
a546fb09f079f2111ea4bae24088b628d0e74736

Update RequestHandler.md

ddereuromark committed 3 months ago

README

The README file for this repository.

Shim plugin for CakePHP

CI Coverage Latest Stable Version Minimum PHP Version License Total Downloads Coding Standards

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.

"0-dependency plugin": Apart from core this plugin has no other dependencies!

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 and fieldByConditions() 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 or modified 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/.