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

WordPress Trac noreply at wordpress.org
Tue Feb 25 16:25:12 UTC 2014


#21663: Use PDO or mysqli for MySQL queries when available
------------------------------+------------------
 Reporter:  scottconnerly     |       Owner:
     Type:  task (blessed)    |      Status:  new
 Priority:  normal            |   Milestone:  3.9
Component:  Database          |     Version:  3.5
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |     Focuses:
------------------------------+------------------

Comment (by nacin):

 Correct, there are a few issues with my patch. Fixed in
 [attachment:21663.14.diff].

 `USE_EXT_MYSQLI` means if we ever add PDO, we would need to continue to
 force MySQLi in order to obey their settings. It would be a permanent
 fixture. An ext/mysql constant, however, would eventually just fade away.

 > I can readily imagine a number of hackers going in there and happily
 define a constant that allows to use the more modern library.

 Honestly, the only reason why I'm even considering the constant is for
 development/testing purposes and easy recourse for broken sites. For this
 situation, said hackers should update to PHP 5.5. If they want to use a
 more modern library, then the onus should be on them to use a more modern
 version of PHP.

 For unit testing, we can extend `wpdb` and set use_mysqli to true. That
 property should probably be protected, not private.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/21663#comment:200>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list