[wp-trac] [WordPress Trac] #16758: PHP5-port - move of wpdb::check_database_version()

WordPress Trac wp-trac at lists.automattic.com
Sat Mar 5 14:04:56 UTC 2011


#16758: PHP5-port - move of wpdb::check_database_version()
-------------------------+-----------------------------
 Reporter:  hakre        |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:  3.1
 Severity:  normal       |   Keywords:  has-patch
-------------------------+-----------------------------
 The function {{{wpdb::check_database_version()}}} is doing a check of the
 database version against a needed database version. The database server
 version is returned from $this->db_version(), the required database
 version is in a global variable called `$required_mysql_version`.

 This keeps the database code coupled to the global variable while the
 class is made to be replaced, e.g. for other database abstractions
 (compare #14508 which is made for ''extends wpdb''). Normally the database
 class is a singleton in a global variable already.

 Therefore this mixes global with local space twice. I suggest to de-couple
 wpdb a bit from that hardencoded global variable name and move the code
 out of the wpdb class into that alread existing global function called
 wp_check_mysql_version().

 This should make the database interface a bit more lightweight which could
 be a benefit when porting to PHP5.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16758>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list