Re: Package proposal
| From: | Ian Eure | Date: | Sun, 10 Oct 2004 08:52:26 +0000 |
| Subject: | Re: Package proposal | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-33745@lists.php.net to get a copy of this message | ||
On Sunday 10 October 2004 12:04 am, Maxim Antipin wrote:
> Hello pear-dev,
>
> We have faced with necessity to have some MySQL API allowing to cache
> SQL queries results as we had lots of same but very resources
> consuming queries returning same data each time in our several last
> projects.
>
> We have looked through packages available in 'Database' section of
> PEAR packages collection and did not find anything suitable.
>
> As MySQL API in PHP4 do not support even queries preparation we have
> created caching package for our purposes and we hope it can be useful
> for rest PHP community.
>
Not to disparage your contribution, but I think there is a better solution.
You could create a 'cmysql' DB driver, which extends DB_mysql and implements
caching. This should have minimal impact on a project already using DB, as
you would only have to change the DSN and add calls in to control the
caching.
You could also use PEAR's Cache package to store the results. You'd get the
benefit of DB's API, and you wouldn't have to write the cache code yourself.
I think you could probably pull something workable together in a couple
hundred lines of code.
Attachment: [application/pgp-signature]
Attachment: [application/pgp-signature]