I'm looking in to writing a new PHP based CMS which handles concurrent edits optimistically like source version control rather than pessimistic locking like Wordpress. I want to be able to write some general PHP pages to handle any conflict in a user friendly way so that conflict solving is simple, history is kept and reverting is easy.
I want to use a database and need to design it first. My ideas so far:
Have a history table storing all updates like in Wordpress with a version number.
When a user saves a record, it will check whether there have been other updates since. This is quite easy to do if you save a checkout version id in the session when the user starts to edit and you can end up with the 3 ids for the saves you want to merge.
How do I display this to the user in a friendly way? I cannot find any information about PHP interfaces for merging things like this. I know there are whole apps like kmerge doing this for just plain text files and I want to know how to do it at a database record level.
Is my design so far solid? What else do I need?