HyperDB
HyperDB copied to clipboard
Upgrade to wordpress 6.1, Deprecated wp-db.php warning
After upgrading to wordpress 6.1 the following warning shows up
Deprecated: File wp-db.php is deprecated since version 6.1.0! Use wp-includes/class-wpdb.php instead. in /usr/src/wordpress/wp-includes/functions.php on line 5595
Does anyone has this problem and managed to solved it?
@miguelBarreiro85, the solution has not been released yet, but it in this repo, on the trunk
branch. You should be able to update to HyperDB 1.9 and get rid of this warning.
The relevant code, to check for which database file to use is:
if ( defined( 'WPDB_PATH' ) ) {
/** @psalm-suppress UnresolvableInclude */
require_once WPDB_PATH;
} elseif ( file_exists( ABSPATH . WPINC . '/class-wpdb.php' ) ) {
// WP 6.1 and later.
/** @psalm-suppress UnresolvableInclude */
require_once ABSPATH . WPINC . '/class-wpdb.php';
} else {
// WP 6.0 and earlier.
/** @psalm-suppress UnresolvableInclude */
require_once ABSPATH . WPINC . '/wp-db.php';
}
Hi, thank you @justinmaurerdotdev