[wp-trac] [WordPress Trac] #27703: Need additional db version information in WP3.9+

WordPress Trac noreply at wordpress.org
Mon Apr 7 22:39:34 UTC 2014


#27703: Need additional db version information in WP3.9+
----------------------------+-----------------------------
 Reporter:  webaware        |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Database        |    Version:  trunk
 Severity:  normal          |   Keywords:
  Focuses:  administration  |
----------------------------+-----------------------------
 We urgently need a new method on class `wpdb` that returns the raw
 database version information string.

 `$wpdb->db_version()` strips out important information required to assist
 plugin writers with debugging, such as the fact that the database is
 MariaDB not MySQL. To get around that, many plugins use
 `mysql_get_server_info()` to get the raw info string. e.g. to pick just a
 few:

 * Easy Digital Downloads
 * Jigoshop
 * NextGEN Gallery / Nextcellent Gallery
 * WooCommerce
 * WP Migrate DB Pro

 In WordPress 3.9+ using mysqli, this throws a Deprecated warning, which is
 reasonable since `mysqli_get_server_info($wpdb->dbh)` should be called
 instead. Since `dbh` is a protected member and `use_mysqli` is a private
 member, plugin writers have no easy way to access this. We need a new
 method on `wpdb` that provides the raw string returned by
 `mysqli_get_server_info`.

 Plugin writers can then test for that new method with `method_exists()`,
 and call it in preference to `mysql_get_server_info()`.

 I reckon this really should make it into 3.9, since it affects a bunch of
 major WordPress plugins.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27703>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list