hightowersu/redbean_rebean 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

hightowersu/redbean_rebean

Composer 安装命令:

composer require hightowersu/redbean_rebean

包简介

This is a plugin for the RedBeanPHP ORM, which will be generating automatically revision tables for given Beans

README 文档

README

This is a plugin for the RedBeanPHP ORM, which will be generating automatically revision tables for given Beans

This is achieved by creating a table named after your beantype plus the "revision" prefix. The table contains all the columns from your bean. Additionally it has a column "action" specifying if this revision was made by an [INSERT,UPDATE,DELETE] statement. Also inlcuded is the column "original_id" which represents the ID of the bean, that's been revisioned. Finally there is a "lastedit" column indicating when the change happend.

All the functionallity is achieved by using AFTER Triggers

Current status: The plugin so far works for Mysql, although not properly tested. Please use it just for testing and NOT IN PRODUCTION so far.

Update:

  • Now uses the R::ext plugin helper so you can access Revisioning without any previous instance creation. Just use R::createRevisionSupport($YOURBEAN);
  • Added PHPUnit Tests
  • Throw Exception if Bean is already under revision support

Usage:

  • Download the latest version of RedBean from Github or install via Composer.
  • Add the file ReBean.php to the RedBean/Plugin folder
  • Either manually require the file or see the RedBean instructions for building your on RB.php file
  • Create your first bean type
  • Store it in the DB (R::store($YOURBEAN))
  • Call the revision method like this
   R::createRevisionSupport($YOURBEAN);
  • Happy modifying of your previous Bean. You should be able to see all changes in the created revisiontable

Example:

Take a look at the included example.php.

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-10-16