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

WordPress Trac noreply at wordpress.org
Thu Jan 17 14:06:17 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 bpetty):

 Replying to [comment:2 scribu]:
 > I don't think we should waste effort on making plugins/themes that still
 don't use $wpdb work in PHP 5.4.

 By my count, I've found 1,722 plugins in the WP.org plugin repository that
 make raw calls to mysql_*() functions. Some might have nothing to to with
 the WP main connection or not actually be calls to core PHP methods, but
 most of them likely are.

 That's 7.4% of all plugins.

 What those plugins are doing is wrong, however, it works, and I don't
 think we should intentionally break them before we absolutely need to. We
 can at least give them a fighting chance by only using the PDO (or mysqli)
 extension when either the mysql extension is no longer available, or just
 on PHP 5.5+ (to avoid dealing with deprecation notices during development
 even though the mysql extension is available). There's not any compelling
 reasons that I see for making the jump any earlier than PHP 5.5; we can
 continue using mysql through PHP 5.4.

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


More information about the wp-trac mailing list