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

WordPress Trac noreply at wordpress.org
Mon Sep 16 04:34:49 UTC 2013


#19324: Allow more flexible mysql_connect configuration (compression, ssl, etc)
--------------------------------+-----------------------
 Reporter:  Otto42              |       Owner:  nacin
     Type:  feature request     |      Status:  reopened
 Priority:  normal              |   Milestone:  3.5
Component:  Database            |     Version:
 Severity:  normal              |  Resolution:
 Keywords:  commit needs-patch  |
--------------------------------+-----------------------
Changes (by ticoombs):

 * cc: ticoombs (added)
 * keywords:  has-patch commit => commit needs-patch
 * status:  closed => reopened
 * resolution:  fixed =>
 * version:  3.2 =>


Comment:

 Moving back to Un-resolved state.

 Current 3.6.1 currently does not have the required fix.

 Proposed fixes,
 wp-includes/load.php
 {{{
 334c334
 <       $wpdb = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST, NEWLINK,
 MYSQL_CLIENT_FLAGS );
 ---
 >       $wpdb = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST );

 }}}
 wp-includes/wp-db.php
 {{{
 479,495d478
 <       /**
 <          * Database Client Flags
 <          *
 <          * @since 3.6.x
 <          * @access protected
 <          * @var string
 <          */
 <         protected $client_flags;
 <
 <       /**
 <          * Database Client Flags
 <          *
 <          * @since 3.6.x
 <          * @access protected
 <          * @var string
 <          */
 <         protected $new_link;
 544c536
 <       function __construct( $dbuser, $dbpassword, $dbname, $dbhost,
 $new_link, $client_flags ) {
 556,558c548
 <
 <               $this->new_link = $new_link;
 <               $this->client_flags = $client_flags;
 1163c1152
 <                       $this->dbh = mysql_connect( $this->dbhost,
 $this->dbuser, $this->dbpassword, $this->new_link, $this->client_flags );
 1165c1154
 <                       $this->dbh = mysql_connect( $this->dbhost,
 $this->dbuser, $this->dbpassword, $this->new_link, $this->client_flags );
 }}}

 Usage:
 wp-config.php
 {{{
 33,36d32
 < /** Database SSL Settings */
 < define('MYSQL_CLIENT_FLAGS', MYSQL_CLIENT_SSL);
 < define('NEWLINK', true );
 }}}

 (If this is in the wrong place, please direct me to the correct place,
 #firstimesubmitter)
 The problem with the current version is that, it will always return 0 for
 MYSQL_CLIENT_FLAGS, even if you define it in wp-config.php. Same goes for
 NEWLINK.

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


More information about the wp-trac mailing list