Re: PHP::Pear::DB
| From: | Stefan Neufeind | Date: | Fri, 19 Sep 2003 11:38:03 +0000 |
| Subject: | Re: PHP::Pear::DB | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-7916@lists.php.net to get a copy of this message | ||
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.
Stefan