Re: QuickForm: anyone have any examples of audit code that logs every edit / change to data?
| From: | Justin Patrin | Date: | Fri, 14 Jan 2005 16:07:57 +0000 |
| Subject: | Re: QuickForm: anyone have any examples of audit code that logs every edit / change to data? | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16930@lists.php.net to get a copy of this message | ||
On Fri, 14 Jan 2005 01:20:29 +0300, Alexey Borzov <borz_off@cs.msu.su> wrote:
> Hi,
>
> l Burnerheimerton wrote:
> > I have several forms in the app. I'd like to log
> > every change the user makes to any data. Not every
> > field on every edit, but only those where data has
> > been changed.
> >
> > Does anyone have some example code or articles on
> > this?
> >
> > ( I am using HTML_Quickform. )
>
> You are most certainly storing your data in the database. In that case you
> should define triggers that will fire after update on the tables in question and
> will write to some audit table.
>
> The actual trigger code is of course DB specific.
>
And then there's DB_DataObject which gives you the same kind of
functionality, only in PHP, making it DB independant. As I said
before, overriding the update() method on a DataObject is a great way
to do this.
--
Justin Patrin