[PHP] Overriding core functions

2006-08-22 Thread Peter Lauri
Hi, I want to add some functionality when calling the mysql_query(): function mysql_query($Query) { //do stuff before mysql_query($Query); //do things after } This would just be for one project where I want to record all Queries and the result of

Re: [PHP] Overriding core functions

2006-08-22 Thread Jochem Maas
Peter Lauri wrote: Hi, I want to add some functionality when calling the mysql_query(): function my_query($Query) { //do stuff before mysql_query($Query); //do things after } // or something like: class PeteDB { var $conn;

Re: [PHP] Overriding core functions

2006-08-22 Thread Paul Scott
On Tue, 2006-08-22 at 18:39 +0700, Peter Lauri wrote: I want to add some functionality when calling the mysql_query(): Why not simply wrap the mysql_query function in a php function? function query($whatever) { log($whatever); $ret = mysql_query($whatever); //do stuff

RE: [PHP] Overriding core functions

2006-08-22 Thread Peter Lauri
] Overriding core functions On Tue, 2006-08-22 at 18:39 +0700, Peter Lauri wrote: I want to add some functionality when calling the mysql_query(): Why not simply wrap the mysql_query function in a php function? function query($whatever) { log($whatever); $ret = mysql_query($whatever

RE: [PHP] Overriding core functions

2006-08-22 Thread Peter Lauri
7:27 PM To: Peter Lauri Cc: php-general@lists.php.net Subject: Re: [PHP] Overriding core functions Peter Lauri wrote: Hi, I want to add some functionality when calling the mysql_query(): function my_query($Query) { //do stuff before mysql_query($Query

Re: [PHP] Overriding core functions

2006-08-22 Thread Alex Turner
:[EMAIL PROTECTED] Sent: Tuesday, August 22, 2006 7:27 PM To: Peter Lauri Cc: php-general@lists.php.net Subject: Re: [PHP] Overriding core functions Peter Lauri wrote: Hi, I want to add some functionality when calling the mysql_query(): function my_query($Query) { //do

Re: [PHP] Overriding core functions

2006-08-22 Thread Arpad Ray
functions :) -Original Message- From: Jochem Maas [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 22, 2006 7:27 PM To: Peter Lauri Cc: php-general@lists.php.net Subject: Re: [PHP] Overriding core functions Peter Lauri wrote: Hi, I want to add some functionality when calling

RE: [PHP] Overriding core functions

2006-08-22 Thread Robert Cummings
On Tue, 2006-08-22 at 22:19 +0700, Peter Lauri wrote: Yes, of course I can do that. But I was just lazy and wanted to reuse the function mysql_query that I am already using. You could look into the runkit extension. I believe it allows this. At any rate, using mysql_xxx() is veyr low level and

Re: [PHP] Overriding core functions

2006-08-22 Thread Arpad Ray
Brad Bonkoski wrote: Some already good workarounds given for this question... BUT. Is it even possible to override a core function? Like I wrote a function called 'exit' and I got a parser error, which leads me to believe it is not even possible to override the core functions. Is this true of

Re: [PHP] Overriding core functions

2006-08-22 Thread Brad Bonkoski
: Jochem Maas [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 22, 2006 7:27 PM To: Peter Lauri Cc: php-general@lists.php.net Subject: Re: [PHP] Overriding core functions Peter Lauri wrote: Hi, I want to add some functionality when calling the mysql_query(): function my_query($Query

Re: [PHP] Overriding core functions

2006-08-22 Thread Richard Lynch
On Tue, August 22, 2006 6:39 am, Peter Lauri wrote: I want to add some functionality when calling the mysql_query(): function mysql_query($Query) { //do stuff before mysql_query($Query); //do things after } This would just be for one project