定制 dereuromark/cakephp-shim 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dereuromark/cakephp-shim

最新稳定版本:3.8.2

Composer 安装命令:

composer require dereuromark/cakephp-shim

包简介

A CakePHP plugin to shim applications between major framework versions.

README 文档

README

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.1+. 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

  • find('list') shim for 1-2 select fields without requiring verbose keyField/valueField options.
  • 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/.

统计信息

  • 总下载量: 988.59k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 40
  • 点击次数: 3
  • 依赖项目数: 9
  • 推荐数: 0

GitHub 信息

  • Stars: 40
  • Watchers: 2
  • Forks: 11
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固