Possible Duplicate:
Redefine Built in PHP Functions
How can I overwrite a built-in PHP function?
I want to overwrite mysql_connection
function, function should check if the connection is already opened, just return that connection or else request for a new connection.
I am working with some legacy system, which has 1000's of connections on each page. This reduces the performance of the website and potentially causes bad memory usage.
I want to rework this in such a way that whenever sql connection request is made, system has to check whether the connection is already there or not.
I can't go and change in all the places to replace the connection to common object because system is not written in MVC.
Anybody can help me?