[wp-hackers] Security Vulnerability found - Forum Post

David Chait davebytes at comcast.net
Fri Apr 15 16:53:31 GMT 2005


the database is opened once, when the $wpdb object is instantiated.  unless plugins are manually accessing the db themselves (which they SHOULDN'T!), one connection is opened when a HTTP request comes in, and remains open only for the context of that request.  if by 'page' you mean 'later included PHP file', that already occurs.  if by 'page' you meant 'next HTTP request', there's no persistance.

-d
  ----- Original Message ----- 
  From: Amit Gupta 
  To: wp-hackers at lists.automattic.com 
  Sent: Friday, April 15, 2005 3:30 AM
  Subject: Re: [wp-hackers] Security Vulnerability found - Forum Post

  Its not about using persistant connections. WP doesn't open a persistant connection. But what I'm saying is that you can access a global object without creating it everytime. I also use ezSQL, the same class that WP uses for db. You create an object of that class & pass connection info to it & it opens a connection. Now to try this out, create a page that defines this db object as global, lets say $mydb & make it an object of the ezSQL class & connect to db. Now in another page, just access the global object $mydb & do some db stuff. You can do that, while you defined $mydb in another page which doesn't have any link with this 2nd page.

  That's what I'm saying to do, that if the db object exists, then there's no need to reload the wp-config as it contains just the db info & we don't need it if a db object already exists for us to use.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://comox.textdrive.com/pipermail/wp-hackers/attachments/20050415/b316445c/attachment.html


More information about the wp-hackers mailing list