[wp-trac] [WordPress Trac] #21663: Use PDO for MySQL queries when PDO is available

WordPress Trac noreply at wordpress.org
Fri Jan 18 16:05:54 UTC 2013


#21663: Use PDO for MySQL queries when PDO is available
--------------------------------------------------+------------------
 Reporter:  scottconnerly                         |       Owner:
     Type:  task (blessed)                        |      Status:  new
 Priority:  normal                                |   Milestone:  3.6
Component:  Database                              |     Version:  3.5
 Severity:  normal                                |  Resolution:
 Keywords:  dev-feedback has-patch needs-testing  |
--------------------------------------------------+------------------

Comment (by deltafactory):

 @sc0ttclark, I asked a similar question. Not sure how to efficiently
 search the code of the repository, short of downloading the entire trunk.

 @wonderboymusic, it's not bending over backward to *keep* the current
 functionality (on some level) while trying to move the platform to its
 most current. I'm surprised you are so gung-ho about leaving people behind
 considering the work you had to do so recently.

 The lead devs are conscious of the "brand" impact this has. WP doesn't
 want a reputation of breaking during updates for a number of reasons that
 I don't need to cover here. The $wpdb->prepare() situation from 3.5 was
 another recent instance where bad plugin code penalized "regular" users
 who had otherwise had a safe experience upgrading WP. I don't think I'm
 alone in my desire to prevent bad plugin code + hasty decisions in core
 from hurting users who aren't web developers.

 I would like to see a phased approach based on what I and others have
 suggested:

 1. Provide a legacy connection with `mysql_connect()` etc, no matter what
 $wpdb uses.
 2. Gather stats about offending plugins in the repository and notify
 authors. (How?)
 3. Announce the intention to deprecate, knowing it probably won't reach
 the offenders.
 4. Possibly scan for `mysql_*()` functions and warn (on the plugin admin
 page, only?)
 5. Remove legacy connection, with option to re-enable by config constant,
 starting in ~3.8

 Dropping `mysql` isn't an option. Its removal from PHP is close enough
 that now is as good a time as any to start "ripping off that band-aid" as
 far as the WP community is concerned.

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


More information about the wp-trac mailing list