views:

81

answers:

3

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

A: 

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

gsk
@OM The Eternity: I don't have enough reputation to comment on the question directly. That's the reason why I put it in answer instead of comments
gsk
+2  A: 

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.

Lucanos
U got directed to different path bud, I want this functionality in one of my Joomla Component.. I have to it all through scripting..
OM The Eternity
@OM You can still use scripting to control the SVN or GIT command line tools. I also think that's the best way to go instead of reinventing the wheel from scratch. (Especially if you, apparently, have little idea how to do so.)
deceze
@deceze I am creating a component for Joomla y should i use this full version control system for a part of work i need to accomplish my component?
OM The Eternity
@OM Because this functionality is not exactly trivial to get right, these VCS are already proven and widely used and it's a perfectly feasible solution. Do you have any technical reasons against it?
deceze
@deceze i am not against it, the point is that I have to create this functionality as a part of whole joomla component, which would be sold to any joomla client, that how could i just do this by using any version control system?
OM The Eternity
I cannot use any system to do this I have to code it..
OM The Eternity
@OM That doesn't mean you can't use already existing libraries... But oh well, it's only a suggestion...
deceze
Its would b very clumsy to use these libraries for me, in my system, help me in other way...plsss
OM The Eternity
+1  A: 

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.

Lucanos