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

WordPress Trac wp-trac at lists.automattic.com
Fri Aug 24 01:38:52 UTC 2012


#21663: Use PDO for MySQL queries when PDO is available
--------------------------------------+------------------------------
 Reporter:  scottconnerly             |       Owner:
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Database                  |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  needs-patch dev-feedback  |
--------------------------------------+------------------------------
Changes (by kurtpayne):

 * keywords:  needs-patch => needs-patch dev-feedback


Comment:

 Related, #21055

 ----

 Patch attached.  Should be fully backwards compatible.  All unit tests
 pass, and no code changes required anywhere outside of wpdb.

 This leaves wpdb alone for the most part, and just swaps in a different
 database driver to handle any msyql_* specific calls.  No new strings,
 even!  It includes drivers for mysql, mysqli, and pdo_mysql.

 This doesn't overreach (no transaction support, and no rewriting of
 prepare ).  It's just designed to address main concern of the ticket:  the
 mysql extension may not be available (due to deprecation?) at some point,
 and wpdb should support other options.

 As we discussed in IRC, this is probably far in the future as deprecation
 notices won't be turned on until after php 5.4 and other drivers (mysqli,
 pdo) have their quirks, too.

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


More information about the wp-trac mailing list