How can i Rollback for files/folders corresponding to the changes done?
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 anyo开发者_C百科ne 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
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.
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.
May be you should try to use the native api of the host operating system
精彩评论