Automattic / HyperDB

HyperDB is an advanced database class that supports replication, failover, load balancing, and partitioning.
104 stars 22 forks source link

Add db_server_info() #114

Closed WPprodigy closed 1 year ago

WPprodigy commented 1 year ago

WP 5.5 added this method: https://github.com/WordPress/WordPress/blob/9c3b7e5e7c94f3f8c5f3766a0d25e801b39a81a5/wp-includes/class-wpdb.php#L3858-L3873

Using it can cause errors on sites though, because hyperdb might not have a connection ready to go, so you end up with:

Warning: mysqli_get_server_info() expects parameter 1 to be mysqli, null given in /var/www/wp-includes/class-wpdb.php on line 3867

We need to do the same thing we did for db_version() to resolve this. I have some questions though I'll leave in review comments.

sonarcloud[bot] commented 1 year ago

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell B 7 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication