Re: Item changelogs and rollback
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Mon, 29 Sep 2008 07:51:26 -0400
Gordon wrote:
I have been wanting to add a changelog capability to our in house CMS
system. The approach I was thinking of was adding a changelog table
to the database. It records the ID of the editor, the timestamp of
when the edit occurred and a list of changes made to the item
edited.
I would like to add this capability for 2 reasons:
a) To see what changes have been made to an article since its last
edit
b) To be able to "roll back" changes to an earlier revision if
necessary
The easy way would be to simply store the entire text of the article
each time in the changelog, but that is of course very wasteful. What
I'd really like to do is store the difference between the current and
the previous version.
Is there a way of achieving this in PHP? I found a few functions in
the manual that claim to analyse strings and work out the differences
but these functions seem to return integers, and what I'd ideally need
is something akin to the output of utilities like diff.
You can do it, but it will be complicated. If you can exec() diff and patch, that will help (but you'll have to save the article to a file temporarily, anyway). Otherwise you'll need to write your own code to get the differences and make the changes.
I think it would be easier to just store the entire article. They aren't that big, are they?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.
- References:
- Item changelogs and rollback
- From: Gordon
- Item changelogs and rollback
- Prev by Date: Re: question about soap
- Next by Date: Re: Item changelogs and rollback
- Previous by thread: Item changelogs and rollback
- Next by thread: Re: Item changelogs and rollback
- Index(es):
Relevant Pages
|