So I’m building a website in php codeigniter, and I have user submitted articles… and I want to have an editing system, kind of like SVN where you can see the changes that have been made, and you can revert to older changes if necessary.. so my question is how do you do that? is there a library that helps with that.. or are there any articles that you guys can recommend on the subject. I was thinking of just making a db table where it has an edit id and a date, and the changes made, then compare it to the original doc.. but I don’t think that is a very officiant method. so any suggestions would be greatly appreciated.
So I’m building a website in php codeigniter, and I have user submitted articles…
Share
You actually already have an answer to this: use
gitorsvn. If you trust your users to make edits and such, you simply have to script something that will submit their changes to the repository. You can then use diff to compare two versions. This can also be nice if you want your users to be able to rollback changes and do other things version control libraries do.If showing the diff syntax is insufficient, you can try to parse it into something prettier or use another method. I’m sure they exist.