是否有现成的 PHP 解决方案可以对数据库字段进行修订控制?
我正在寻找可以用来在 PHP 中进行版本控制的东西(不适用于代码)。我想对用户编辑的文本输入进行修订控制。
我发现了一些适合 Ruby 的好东西(https://github.com/courtenay/acts_like_git),但找不到任何适合 PHP 的东西。
难道它不存在吗?
I'm looking for something that I can use to do versioning in PHP (not for code). I'd like to do revision control for a text input users edit.
I've found something great for Ruby (https://github.com/courtenay/acts_like_git) but can't find anything for PHP.
Does it not exist?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用支持版本控制行为的 ORM 解决方案之一。 Doctrine 和Propel 支持这一点,而且可能还有更多。
或者也许我误读了你的问题,而你正在寻找模型本身的版本控制而不是数据的版本控制?
You could use one of the ORM solutions that support versioning behavior. Both Doctrine and Propel support this, and there probably are even more.
Or maybe I misread your question, and you're looking for versioning of the model itself instead of versioning your data?
这看起来很有希望,但我不知道它的效果如何。你会帮我测试一下吗? :P
http://code.google.com/p/ruckusing/
This looks promising, but I don't know how well it works. Will you test it for me? :P
http://code.google.com/p/ruckusing/
使用唯一的时间戳怎么样?这必须加以完善,但你明白我的意思。
或者您想跟踪用户对巨大文本所做的确切更改吗?我认为这取决于您到底想要做什么,真实语言文本的 b/c 版本可能会引发冲突,必须在用户“提交”其更改之前手动解决冲突。可能很难确定……但要看情况。
最好的问候
拉斐尔
how about using a UNIQUE TIMESTAMP? This has to be refined, but you get my point.
Or do you want to keep track of the exact changes a user made to a huge text? I think it depends on what it exactly is you want to do, b/c versioning of real-language-texts might trigger conflicts that have to be resolved manually before the user can "commit" his change. Might be tough to establish ... but depends.
Best regards
Raffael