如何回滚与所做更改相对应的文件/文件夹?

发布于 2024-09-01 16:11:03 字数 290 浏览 2 评论 0原文

我正在使用 PHP 和 Mysql

我有 PHP 脚本,其中我回滚数据库中的所有数据,如果更新完成,所有旧值都会重置到数据库,如果新插入完成,所有新值都会被删除。 现在我的目标是对与已完成的更改相关的文件/文件夹执行相同的过程,我无法创建一个想法来使用与更改相关的文件/文件夹执行回滚作业。所以你们中的任何人都可以帮助我吗或者指导我得到最好的主意???

已编辑 我希望在我的 Joomla 组件之一中实现此功能。我必须通过脚本来实现这一切

I am using PHP and Mysql

I have PHP script in which I rollback all the data in the database such data all the old value be reset to the database if update is done, and all new value gets deleted if new insert has been done.
Now my goal is to perform the same process with files/folders associated with the changes done, I am not able to create an idea for doing the rollback job with the files/folders associated with the Changes.. So can anyone of u help me or direct me to get the best idea?????

EDITED
I want this functionality in one of my Joomla Component.. I have to it all through scripting

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

太阳男子 2024-09-08 16:11:03

当涉及到管理历史记录并提供“回滚”到特定站点范围快照的功能时,建议您研究源代码管理系统/技术,例如 GITSubversion 等。

这些系统似乎是管理源代码开发的行业标准,并且应该提供您所说的功能。

When it comes to managing histories and providing the functionality to "rollback" to a specific site-wide snapshot, you are probably well-advised to be looking into Source Code Management systems/techniques such as GIT, Subversion, etc.

These systems seem to be the industry standard for managing source code development, and should provide the functionality of which you speak.

甩你一脸翔 2024-09-08 16:11:03

如果您希望为这些文件和文件夹创建一个独立的版本控制系统,那么您需要自定义创建一个,从而对文件的任何更改也会记录该文件的内容(以及更改日期/时间)到 MySQL 表中,或者您可能需要考虑将现有的 PHP/MySQL 版本控制系统调整为您产品的组件(当然,尊重其许可条款)。

我建议在 Google 中搜索“php 版本控制”,然后查看结果以找到最适合您需求的选项。

If you are looking to create a self-contained Version Control system for these files and folders, then you will either need to custom create one, whereby any change to a file also records the contents of that file (and the change date/time) into a MySQL Table, or you may need to look at adapting an existing PHP/MySQL Version Control system as a component of your product (respecting, of course, their licensing terms).

I would recommend performing a Google Search for "php version control", and then looking through the results for an option which best suits your needs.

相思故 2024-09-08 16:11:03

也许你应该尝试使用主机操作系统的本机 api

May be you should try to use the native api of the host operating system

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文