RE: [PEAR] PHP::Pear::DB
| From: | Lukas Smith | Date: | Fri, 19 Sep 2003 11:40:36 +0000 |
| Subject: | RE: [PEAR] PHP::Pear::DB | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-7917@lists.php.net to get a copy of this message | ||
> From: Stefan Neufeind [mailto:stefan@neufeind.net]
> Sent: Friday, September 19, 2003 1:38 PM
> On 19 Sep 2003 at 13:31, patrick.allaert@belgacom.be wrote:
>
> > Just a simple question:
> >
> > I would like to log every queries passed to a DB object, since I am
> > using DB::connect() (who return me a DB_Common object) to connect to
> > my MySQL DB.
> >
> > Of course I could create a function who log the query and then query
> > the database... but this is not the OO way !
> >
> > Does someone have an idea on how to personalize the behavior of a
> > function like DB_Common::query() without modifying original files
and
> > in a OO way ?
>
> Hi,
>
> could you maybe extend the driver (write your "mymysqldriver" driver)
> which simply extends the original one? Don't know if this is the best
> solution - but maybe it helps you for an inspiration. Should be easy
> to write - and all you need to change is the driver when connecting.
Ah yes you can of course modify each driver.
Regards,
Lukas