[wp-hackers] WP and Plugins DB connection conflicts
otto at ottodestruct.com
Wed Jun 27 13:32:48 GMT 2007
On 6/26/07, Peter Adams <peter at oncefuture.com> wrote:
> There are cases when plugins need to create/manage/teardown their own
> link to the same database that WP uses using the exact same user
I'd be interested to know what these cases are, because I can't think
of any. Plugins already have the $wpdb connection available to them,
why would they ever need to make another connection to the same DB?
> What I was suggesting was to force php to create a new link to the DB
> when $wpdb is _first_ created - not every time it's accessed.
You're missing my point. $wpdb is first created every time anybody
loads a page on the website. PHP is not persistent across hits. So
forcing every single hit to the site to always get a new DB link is a
huge amount of overhead for next to no gain.
More information about the wp-hackers