[wp-trac] [WordPress Trac] #19324: Allow more flexible mysql_connect configuration (compression, ssl, etc)

WordPress Trac wp-trac at lists.automattic.com
Tue Nov 22 03:35:30 UTC 2011


#19324: Allow more flexible mysql_connect configuration (compression, ssl, etc)
-----------------------------+-----------------------------
 Reporter:  Otto42           |      Owner:
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Database         |    Version:
 Severity:  normal           |   Keywords:
-----------------------------+-----------------------------
 In wp-db.php, mysql is connected like so:

 {{{
 if ( WP_DEBUG ) {
         $this->dbh = mysql_connect( $this->dbhost, $this->dbuser,
 $this->dbpassword, true );
 } else {
         $this->dbh = @mysql_connect( $this->dbhost, $this->dbuser,
 $this->dbpassword, true );
 }
 }}}

 The "true" forces a new link to be established (not allowing connection
 reuse), and no fifth parameter means that one cannot use the mysql client
 constants, such as MYSQL_CLIENT_SSL for SSL support or
 MYSQL_CLIENT_COMPRESS for compression. Things like that.

 Suggest adding filters or some kind of hooks here to allow these to be
 defined/overridden by plugins as well. SSL support especially would be
 nice for people who have separate DB servers and want a small extra smidge
 of security over that link.

 Currently the only way to really do this and be semi-forward-compatible is
 to copy wp-db.php into wp-content/db.php and modify the file directly. Not
 exactly upgrade friendly.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19324>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list