Re: Item changelogs and rollback
- From: Gordon <gordon.mcvey@xxxxxxxxxxxx>
- Date: Mon, 29 Sep 2008 08:17:56 -0700 (PDT)
On Sep 29, 12:53 pm, "C. (http://symcbean.blogspot.com/)"
<colin.mckin...@xxxxxxxxx> wrote:
On 29 Sep, 12:39, Gordon <gordon.mc...@xxxxxxxxxxxx> 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.
Why not use diff with temporary files (see also man patch). But it
might just be simpler to maintain the content in numbered files via
CVS?
C.
My first thought was to do that, but to be honest I'd rather not be
dependant on a host having particular extermal programs available, as
the CMS needs to run in several different environments and with
different configurations. Some will have the exec() function disabled,
some won't have Diff installed (for example PHP on a Windows server).
I did take a brief look at xdiff but ruled it out for the same
reason.
The MediaWiki software seems to support what I want to be able to do
without resorting to extensions or external programs, but
unfortunately the MediaWiki source code is rather tricky to follow and
I've not managed to work out how it works yet.
.
- Follow-Ups:
- Re: Item changelogs and rollback
- From: r0g
- Re: Item changelogs and rollback
- References:
- Item changelogs and rollback
- From: Gordon
- Re: Item changelogs and rollback
- From: C. (http://symcbean.blogspot.com/)
- Item changelogs and rollback
- Prev by Date: Re: php scripts and tripple slashes
- Next by Date: Re: html forms and spam-bots
- Previous by thread: Re: Item changelogs and rollback
- Next by thread: Re: Item changelogs and rollback
- Index(es):
Relevant Pages
|