Opened 12 years ago
Closed 10 years ago
#16758 closed enhancement (wontfix)
PHP5-port - move of wpdb::check_database_version()
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.1 |
Component: | General | Keywords: | has-patch |
Focuses: | Cc: |
Description
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.
Attachments (2)
Change History (3)
#1
@
10 years ago
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
The suggested change here would cause DB dropins compatibility issues.
For example, currently a DB dropin can replace the wpdb::check_database_version()
method with a check for >= 1.0 (If that's the version of the server they require) and ignore the global $required_mysql_version
.
With this change, a DB Dropin would have to make sure it returned a MySQL version number >= $required_mysql_version
in order to work, which would be a step backwards in becoming DB agnostic.
I don't really see a problem with $wpdb relying on the global, When wpdb is used stand alone, the method wouldn't be used either.
with _deprecated_function() call#